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

FileOperations.deleteRecursiveOnExit() doesn't seem to work #2016

Closed
chanseokoh opened this issue Sep 23, 2019 · 0 comments · Fixed by #2018
Closed

FileOperations.deleteRecursiveOnExit() doesn't seem to work #2016

chanseokoh opened this issue Sep 23, 2019 · 0 comments · Fixed by #2018

Comments

@chanseokoh
Copy link
Member

I always get the following exception (triggered when specifying a Docker base image, as Jib tries to delete a temp directory from docker save) with Maven. Gradle doesn't complain, but it doesn't delete the temp directory either. I think JVM unloads classes by the time the shutdown hook code executes, unfortunately. But deleting a directory recursively may already be too expensive to be executed as a shutdown hook. I wish we could delete these directories much earlier before JVM termination.

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.810 s
[INFO] Finished at: 2019-09-23T12:47:38-04:00
[INFO] ------------------------------------------------------------------------
Exception in thread "Thread-3" Exception in thread "Thread-2" java.lang.NoClassDefFoundError: com/google/common/io/RecursiveDeleteOption
        at com.google.cloud.tools.jib.filesystem.FileOperations.lambda$deleteRecursiveOnExit$1(FileOperations.java:102)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.google.common.io.RecursiveDeleteOption
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
        ... 2 more
java.lang.NoClassDefFoundError: com/google/common/io/RecursiveDeleteOption
        at com.google.cloud.tools.jib.filesystem.FileOperations.lambda$deleteRecursiveOnExit$1(FileOperations.java:102)
        at java.lang.Thread.run(Thread.java:748)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants