tiny-remapper icon indicating copy to clipboard operation
tiny-remapper copied to clipboard

Concurrency issue with ZipFileSystemProvider.newFileSystem

Open sargunv opened this issue 5 years ago • 7 comments

ZipFileSystemProvider can only provide one FileSystem instance per URI. I'm getting a FileSystemAlreadyExistsException when building a mod in CircleCI. Here's a sample log: https://pastebin.com/5MjxLqfd

sargunv avatar Mar 26 '19 07:03 sargunv

It is tbd whether this should be changed in tiny-remapper. Right now it assumes none of the inputs were opened elsewhere and cleans up after itself. The global state of FileSystems is unfortunate, especially once someone closes them...

sfPlayer1 avatar Mar 26 '19 22:03 sfPlayer1

Interesting, so are you saying something else in the FabricMC stack opened the file or something outside entirely? This build was in CI so I'd assume only something within the FabricMC stack could be the culprit.

sargunv avatar Mar 27 '19 02:03 sargunv

Yes it's most certainly a (known) issue in Loom (Fabric's gradle plugin), it doesn't reliably close files and is being reworked.

sfPlayer1 avatar Mar 27 '19 02:03 sfPlayer1

Cool, is there an open issue there I can subscribe to? Took a cursory look and didn't see one.

On Tue, Mar 26, 2019 at 19:31 Player [email protected] wrote:

Yes it's most certainly a (known) issue in Loom (Fabric's gradle plugin), it doesn't reliably close files and is being reworked.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FabricMC/tiny-remapper/issues/7#issuecomment-476941284, or mute the thread https://github.com/notifications/unsubscribe-auth/ABQlpVJvv0EYCqgJz8kK1zmlT_Y_eWhPks5vatgHgaJpZM4cKuyV .

sargunv avatar Mar 27 '19 02:03 sargunv

If you can find a way to re-produce it, that would help a lot, especially if its on a local system. I fixed most of the locked file issues, and I know of one that is still around. But that last one only affects gen sources.

As your issue seems a little different from what ive seen in the either make a new issue, or add to the following.

https://github.com/FabricMC/fabric-loom/issues/45

Thanks.

modmuss50 avatar Mar 27 '19 02:03 modmuss50

I am going to leave a comment on this as well. I am working on using Gradle transformers within loom to remap dependencies from one mapping into a next. This internally uses an instance of TinyRemapper as a library and by design Gradle executes all transformers in parallel. This of course immediately causes issues with the fact that ZipFileSystems of the same URI return the same instance and causes them to already be closed when the system processes them.

The link to the Loom PR: https://github.com/FabricMC/fabric-loom/pull/156 Currently still working on improving the implementation but I would need this to be fixed eventually. Possibly a synchronization needs to occur on all read methods to prevent this from happening.

marchermans avatar Dec 01 '19 09:12 marchermans

This can be closed with https://github.com/FabricMC/tiny-remapper/commit/8f65b51ec7f2a8431764dc4e841e388c672ff034 @sfPlayer1

natanfudge avatar Dec 01 '19 12:12 natanfudge