Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EEDEE200D60 for ; Fri, 1 Dec 2017 08:55:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id ED5F8160C19; Fri, 1 Dec 2017 07:55:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 18917160BFB for ; Fri, 1 Dec 2017 08:55:08 +0100 (CET) Received: (qmail 5233 invoked by uid 500); 1 Dec 2017 07:55:07 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 5222 invoked by uid 99); 1 Dec 2017 07:55:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2017 07:55:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B55E0C1814 for ; Fri, 1 Dec 2017 07:55:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.811 X-Spam-Level: X-Spam-Status: No, score=-99.811 tagged_above=-999 required=6.31 tests=[KB_WAM_FROM_NAME_SINGLEWORD=0.2, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id YnGy7tVXuiCj for ; Fri, 1 Dec 2017 07:55:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 0B48C5F523 for ; Fri, 1 Dec 2017 07:55:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 37B21E04AB for ; Fri, 1 Dec 2017 07:55:03 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1BDB321065 for ; Fri, 1 Dec 2017 07:55:01 +0000 (UTC) Date: Fri, 1 Dec 2017 07:55:01 +0000 (UTC) From: "Viliam Durina (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (KAFKA-6291) Cannot close EmbeddedZookeeper on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 01 Dec 2017 07:55:10 -0000 Viliam Durina created KAFKA-6291: ------------------------------------ Summary: Cannot close EmbeddedZookeeper on Windows Key: KAFKA-6291 URL: https://issues.apache.org/jira/browse/KAFKA-6291 Project: Kafka Issue Type: Bug Components: zkclient Affects Versions: 1.0.0, 0.11.0.0 Environment: Windows 10 (doesn't reproduce on Linux) JDK 8 Reporter: Viliam Durina We created {{EmbeddedZookeeper}} and {{ZkClient}} for various tests using this code: {{ EmbeddedZookeeper zkServer = new EmbeddedZookeeper(); ZkClient zkClient = new ZkClient("127.0.0.1" + ':' + zkServer.port(), 30000, 30000, ZKStringSerializer$.MODULE$); zkClient.close(); zkServer.shutdown(); }} This works fine on Linux, but on Windows, the {{zkServer.shutdown()}} call fails with this exception: {{ [Thread-1] ERROR org.apache.kafka.test.TestUtils - Error deleting C:\Users\vilo\AppData\Local\Temp\kafka-5521621147877426083 java.nio.file.FileSystemException: C:\Users\vilo\AppData\Local\Temp\kafka-5521621147877426083\version-2\log.1: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at org.apache.kafka.common.utils.Utils$1.visitFile(Utils.java:630) at org.apache.kafka.common.utils.Utils$1.visitFile(Utils.java:619) at java.nio.file.Files.walkFileTree(Files.java:2670) at java.nio.file.Files.walkFileTree(Files.java:2742) at org.apache.kafka.common.utils.Utils.delete(Utils.java:619) at org.apache.kafka.test.TestUtils$1.run(TestUtils.java:184) java.nio.file.FileSystemException: C:\Users\vilo\AppData\Local\Temp\kafka-5521621147877426083\version-2\log.1: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at org.apache.kafka.common.utils.Utils$1.visitFile(Utils.java:630) at org.apache.kafka.common.utils.Utils$1.visitFile(Utils.java:619) at java.nio.file.Files.walkFileTree(Files.java:2670) at java.nio.file.Files.walkFileTree(Files.java:2742) at org.apache.kafka.common.utils.Utils.delete(Utils.java:619) at kafka.zk.EmbeddedZookeeper.shutdown(EmbeddedZookeeper.scala:53) at com.hazelcast.jet.KafkaTest.test(KafkaTest.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) }} My workaround is to comment out the {{zkServer.shutdown()}} call, however this leaves GBs of files in temp directory. -- This message was sent by Atlassian JIRA (v6.4.14#64029)