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

Concurrency issue with ZipFileSystemProvider.newFileSystem #7

Open
sargunv opened this issue Mar 26, 2019 · 7 comments
Open

Concurrency issue with ZipFileSystemProvider.newFileSystem #7

sargunv opened this issue Mar 26, 2019 · 7 comments

Comments

@sargunv
Copy link

sargunv commented Mar 26, 2019

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

@sfPlayer1
Copy link
Collaborator

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...

@sargunv
Copy link
Author

sargunv commented Mar 27, 2019

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.

@sfPlayer1
Copy link
Collaborator

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

@sargunv
Copy link
Author

sargunv commented Mar 27, 2019 via email

@modmuss50
Copy link
Member

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.

FabricMC/fabric-loom#45

Thanks.

@marchermans
Copy link

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: FabricMC/fabric-loom#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.

@natanfudge
Copy link
Contributor

This can be closed with 8f65b51 @sfPlayer1

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

5 participants