mrkkrp / zip

Efficient library for manipulating zip archives
Other
81 stars 27 forks source link

Ignore DoesNotExistError in removeFile #61

Closed cocreature closed 4 years ago

cocreature commented 4 years ago

We have seen a bunch of errors on CI of the form

C:\users\foobar\ghcBDA1.zip: DeleteFile "\\\\?\\C:\\users\\foobar\\ghcBDA1.zip": does not exist (The system cannot find the file specified.)

I haven’t managed to reproduce this but looking at the code it seems like we can be interrupted with an async exception (we kill threads pretty aggressively) in the bracketOnError call after the file has been renamed but before the whole block returns. In this case, the file will not exist but you’ll run the cleanup in bracketOnError anyway which will then fail.

We could try to fix this by masking things differently but ignoring the error seems like a simpler and more robust solution.

mrkkrp commented 4 years ago

Were you able to confirm that this change fixes the issue for you?

mrkkrp commented 4 years ago

We need to add a changelog entry, too.

cocreature commented 4 years ago

Were you able to confirm that this change fixes the issue for you?

Given that it’s somewhat racy I can’t give full confirmation but so far it’s looking good.

cocreature commented 4 years ago

Added a changelog entry.

mrkkrp commented 4 years ago

Thanks! Going to publish now.

cocreature commented 4 years ago

Awesome, that was super quick. Thank you!