Skip to content

OverlappingFileLockException #63

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

Closed
taig opened this issue Jun 29, 2021 · 4 comments
Closed

OverlappingFileLockException #63

taig opened this issue Jun 29, 2021 · 4 comments

Comments

@taig
Copy link

taig commented Jun 29, 2021

I'm seeing this exception pop up in my CI integration tests rather frequently. I assume it is related to the concurrent execution of the test framework. For me, it is sufficient to simply catch and retry, but perhaps you can find a proper way to handle this:

Caused by: java.nio.channels.OverlappingFileLockException
	at java.base/sun.nio.ch.FileLockTable.checkList(FileLockTable.java:229)
	at java.base/sun.nio.ch.FileLockTable.add(FileLockTable.java:123)
	at java.base/sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1154)
	at java.base/java.nio.channels.FileChannel.tryLock(FileChannel.java:1165)
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres.prepareBinaries(EmbeddedPostgres.java:810)
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres.<init>(EmbeddedPostgres.java:133)
	at io.zonky.test.db.postgres.embedded.EmbeddedPostgres$Builder.start(EmbeddedPostgres.java:583)
	...
@tomix26
Copy link
Collaborator

tomix26 commented Aug 1, 2021

Thanks for the report, I'll take a look at it.

@tomix26
Copy link
Collaborator

tomix26 commented Aug 15, 2021

I am sorry for the late response. However, I need to ask if you are using SBT server or custom classloader or something similar that could cause the same class to be loaded multiple times in the same Java virtual machine?

@taig
Copy link
Author

taig commented Sep 9, 2021

Yes, I'm using this library with sbt. As far as I know, sbt server is not involved when running sbt in batch mode on CI, but the issue occurs in this environment nonetheless. But still, sbt does a lot of classpath magic behind the scenes that I occasionally run into. So if the reported issue might be caused by classloader issues, I'm still convinced that sbt is to blame here.

@tomix26
Copy link
Collaborator

tomix26 commented Nov 14, 2021

Sorry, SBT is not supported at the moment. There are some other problems regarding classpath magic and I am not familiar enough with it to be able to solve them. For instance this one: #65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants