The Wayback Machine - https://web.archive.org/web/20210916024745/https://github.com/go-gitea/gitea/pull/16435
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

Retry rename on lock induced failures #16435

Merged

Conversation

@zeripath
Copy link
Contributor

@zeripath zeripath commented Jul 15, 2021

Due to file locking on Windows it is possible for an os.Rename to fail if the files or directories are being used elsewhere.

This PR simply suggests retrying the rename again similar to how we handle the equivalent problem in os.Remove.

Fix #16427

Signed-off-by: Andrew Thornton [email protected]

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix go-gitea#16427

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath
Copy link
Contributor Author

@zeripath zeripath commented Jul 15, 2021

If this PR succeeds at solving the problem we could/should include it in 1.15

zeripath added a commit to zeripath/gitea that referenced this issue Jul 15, 2021
Backport go-gitea#16435

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix go-gitea#16427

Signed-off-by: Andrew Thornton <[email protected]>
@lafriks lafriks added this to the 1.15.0 milestone Jul 15, 2021
@codecov-commenter

This comment was marked as off-topic.

@techknowlogick techknowlogick merged commit 33a8eec into go-gitea:main Jul 15, 2021
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/drone/pr Build is running
Details
approvals/lgtm this commit looks good
zeripath added a commit to zeripath/gitea that referenced this issue Jul 15, 2021
Backport go-gitea#16435

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix go-gitea#16427

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
@zeripath zeripath deleted the fix-16427-retry-renames-like-removes branch Jul 15, 2021
lafriks pushed a commit that referenced this issue Jul 15, 2021
Backport #16435

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix #16427

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: techknowlogick <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 16, 2021
Unfortunately go-gitea#16435 asserts the wrong error and should use
os.LinkError not os.PathError.

Fix go-gitea#16439

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 16, 2021
Backport go-gitea#16461

Unfortunately go-gitea#16435 asserts the wrong error and should use
os.LinkError not os.PathError.

Fix go-gitea#16439

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Jul 16, 2021
Backport go-gitea#16461

Unfortunately go-gitea#16435 asserts the wrong error and should use
os.LinkError not os.PathError.

Fix go-gitea#16439

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit that referenced this issue Jul 16, 2021
Backport #16461

Unfortunately #16435 asserts the wrong error and should use
os.LinkError not os.PathError.

Fix #16439

Signed-off-by: Andrew Thornton <[email protected]>
6543 pushed a commit that referenced this issue Jul 16, 2021
Unfortunately #16435 asserts the wrong error and should use
os.LinkError not os.PathError.

Fix #16439

Signed-off-by: Andrew Thornton <[email protected]>
techknowlogick pushed a commit that referenced this issue Jul 16, 2021
Backport #16461

Unfortunately #16435 asserts the wrong error and should use
os.LinkError not os.PathError.

Fix #16439

Signed-off-by: Andrew Thornton <[email protected]>
AbdulrhmnGhanem added a commit to kitspace/gitea that referenced this issue Aug 10, 2021
* Retry rename on lock induced failures

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix go-gitea#16427

Signed-off-by: Andrew Thornton <[email protected]>

* resolve CI fail

Co-authored-by: techknowlogick <[email protected]>
AbdulrhmnGhanem added a commit to kitspace/gitea that referenced this issue Aug 10, 2021
Unfortunately go-gitea#16435 asserts the wrong error and should use
os.LinkError not os.PathError.

Fix go-gitea#16439

Signed-off-by: Andrew Thornton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

5 participants