-
Notifications
You must be signed in to change notification settings - Fork 244
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
PR 910 introduces regression whereby sorting collection throws exceptions at JVM exit #1029
Comments
I guess that this can be solved using I can't do a PR until next week, so if it's urgent I'll recommend to submit it by yourself. Sorry for the inconvenience... |
This also implies that the SortSam isn't tested in a way that forces files to be written to disk...hmmm. |
@yfarjoun I don't think that's right. I think it's that SortSam isn't tested in a way that the JVM it's running in exits such that it triggers the JVM shutdown hooks that run this code. |
ah... good point. |
@tfenne @yfarjoun What Tim said. The SortingCollectionTest reliably succeeds, but then the test runner throws like crazy when shutting down.
|
fixing the crash on shutdown introduced in #910 by changin the command that gets run on deleteOnExit Files.delete() -> Files.deleteIfExists() this will prevent the jvm from crashing on shutdown if the temporary files get cleaned up before it closes This still leaves open the possibilty of crash on shutdown if the temporary file is unable to be removed for some other reason. That's subtly different than the File version of deleteOnExit, but it may be useful to get these error messages in the unusual case of failing to delete a file that exists.
* fixing the crash on shutdown introduced in #910 by changing the command that gets run on on deleteOnExit Files.delete() -> Files.deleteIfExists() this will prevent the jvm from crashing on shutdown if the temporary files get cleaned up before it closes * This still leaves open the possibilty of crash on shutdown if the temporary file is unable to be removed for some other reason. That's subtly different than the File version of deleteOnExit, but it may be useful to get these error messages in the unusual case of failing to delete a file that exists. * fixes #1029
@magicDGS It looks to me like your PR #910 changes the behavior of temporary file creation and cleanup in a way that breaks lots of downstream usage.
The problem appears to be in
DeletePathThread
where it attempts to delete a Path and rethrows any exceptions that are encountered. The problem is that one of those exceptions that can be thrown is aNoSuchFileException
because the file has already been cleaned up.Running SortSam using the latest version of Picard I get:
This is happening, I believe, because
SortingCollection
has already cleaned up it's temporary files on close, and the belt-and-suspenders of deleting on exit fails because the files are no longer there.The text was updated successfully, but these errors were encountered: