Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.RuntimeException: Failed to delete C:\Users\Z00607~1\AppData\Local\Temp\kafka-unit3906241152275309526 #61

Open
zhy-brian-online opened this issue Jan 18, 2022 · 3 comments

Comments

@zhy-brian-online
Copy link

Hello Salesforce team!

First of all thanks for your great testing library. During my use kafka-junit5, I found a bug. After I run the test code, there is a situation where the temporary file cannot be deleted. I think this is a windows 10 problem. Do you have any good solution? The specific error information is as follows:

9767 [Thread-39] ERROR o.a.z.server.NIOServerCnxnFactory - Thread Thread[Thread-39,5,main] died
java.lang.RuntimeException: Failed to delete C:\Users\Z006071\AppData\Local\Temp\kafka-unit3906241152275309526
at com.salesforce.kafka.test.Utils.lambda$recursiveDeleteOnShutdownHook$0(Utils.java:86)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.FileSystemException: C:\Users\Z00607
1\AppData\Local\Temp\kafka-unit3906241152275309526\version-2\log.1: another program is using this file and the process cannot access it.

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 com.salesforce.kafka.test.Utils$1.visitFile(Utils.java:71)
at com.salesforce.kafka.test.Utils$1.visitFile(Utils.java:68)
at java.nio.file.Files.walkFileTree(Files.java:2670)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at com.salesforce.kafka.test.Utils.lambda$recursiveDeleteOnShutdownHook$0(Utils.java:68)
... 1 common frames omitted

9767 [Thread-42] ERROR o.a.z.server.NIOServerCnxnFactory - Thread Thread[Thread-42,5,main] died
java.lang.RuntimeException: Failed to delete C:\Users\Z006071\AppData\Local\Temp\kafka-unit9105315348829073072
at com.salesforce.kafka.test.Utils.lambda$recursiveDeleteOnShutdownHook$0(Utils.java:86)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.nio.file.FileSystemException: C:\Users\Z00607
1\AppData\Local\Temp\kafka-unit9105315348829073072\BodyMSG0305000500-0\00000000000000000000.index: another program is using this file and the process cannot access it.

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 com.salesforce.kafka.test.Utils$1.visitFile(Utils.java:71)
at com.salesforce.kafka.test.Utils$1.visitFile(Utils.java:68)
at java.nio.file.Files.walkFileTree(Files.java:2670)
at java.nio.file.Files.walkFileTree(Files.java:2742)
at com.salesforce.kafka.test.Utils.lambda$recursiveDeleteOnShutdownHook$0(Utils.java:68)
... 1 common frames omitted

Thanks a lot! Looking forward to your reply.

Brian

@gquintana
Copy link
Contributor

May be related to issue #62

@Skym0sh0
Copy link

Have you found any workarounds?
Or is there an udpate coming to fix this issue (or #62 )?
I suffer from the same problems but I can not downgrade to Kafka 2.x

@OneCricketeer
Copy link

One workaround would be to use TestContainers instead as it would pull a Linux-based Docker image + filesystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants