Skip to content

Conversation

@Dairus01
Copy link

@Dairus01 Dairus01 commented Jan 15, 2026

This PR adds retry logic to the set method in ConsistentFileAnalysisStore to handle Windows file locking issues, where IO.move can fail with "Access is denied" on CI environments like AppVeyor.

Closes sbt/sbt#7976

@Dairus01
Copy link
Author

@eed3si9n Please I would love for you to review this PR

@eed3si9n
Copy link
Member

Interesting. I've already implemented retry on move in Dec 2024 (sbt/io#398). If the problem is still happening, simply retrying I don't think will change the situation.

@Dairus01
Copy link
Author

Interesting. I've already implemented retry on move in Dec 2024 (sbt/io#398). If the problem is still happening, simply retrying I don't think will change the situation.

This PR adds targeted retry logic to ConsistentFileAnalysisStore.set for Windows file locking issues. While sbt/io#398 added general retry to IO.move, the "Access is denied" error still occurs in CI environments like AppVeyor. This suggests the existing retry may not cover this specific case (e.g., during the copyFile fallback in IO.move). This fix retries specifically on FileNotFoundException with "Access is denied", with a 100ms delay, to allow potential lock release.

@eed3si9n
Copy link
Member

I reported sbt/sbt#7976 on Dec 26, 2024:

[info] [error] java.io.FileNotFoundException: C:\temp\sbt_89e589ea\target\out\jvm\scala-3.6.2\absolute-path-in-bat\zinc\inc_compile_3.zip (Access is denied)

and I sent sbt/io#398 a few days afterwards. Retry(...) should retry on all non-fatal exceptions, so that should include FileNotFoundException. So unless we want to go check on AppVeyor, maybe we should close the issue for now?

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

Successfully merging this pull request may close these issues.

[2.x] compile on AppVeyor causes java.io.FileNotFoundException: C:\temp\....\inc_compile_3.zip (Access is denied)

2 participants