-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
FileSystemStorageProvider throws FileAlreadyExistsException during concurrent put operation #2027
Comments
I will have a look at the code when I have time and maybe provide a PR. But that may take some time. |
I've lately introduced some changes to the related codebase, so there's a possibility that something like that may happen. I don't think it should terminate the instance tho - what's the exit code for the app? 🤔 As a quick fix, we should add
Eventually, we should just implement some sort of a queue for mirrored artifacts to get rid of such situations. We already have IO executor service, so we could reuse that for this particular use case. |
I still get the There is also a By the way it seems there is also a kotlin variant of the May be it is better to first check if the destination File exists and if the content is equal?
|
Nice catch man, indeed, we're catching a wrong exception. Without a dedicated import, it imports the one you've mentioned: package kotlin.io
open public class FileSystemException(
public val file: File,
public val other: File? = null,
public val reason: String? = null
) : IOException(constructMessage(file, other, reason))
/**
* An exception class which is used when some file to create or copy to already exists.
*/
public class FileAlreadyExistsException(
file: File,
other: File? = null,
reason: String? = null
) : FileSystemException(file, other, reason) I didn't even know it exists. Let's convert this into an issue and continue there. |
What happened?
While using reposilite and opening a new gradle project (building for the first time with lots of dependencies and modules)
reposilite terminated suddenly.
It seems that concurrent access to a non existent resource (not cached but then fetched from the mirrored repo) leads to some sort of race condition. Also, I assume that the current behavior leads to multiple parallel downloads of the same file from the mirrored repository.
See the log output for more information.
Reposilite version
3.x
Relevant log output
The text was updated successfully, but these errors were encountered: