Skip to content

Make checkout lock failure retryable #177

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

Merged
merged 1 commit into from
Jan 28, 2014

Conversation

mshibuya
Copy link
Contributor

@mshibuya mshibuya commented Nov 1, 2013

In a shared workspace environment, git checkout occasionally fails because another concurrent build has lock on the git repository(.git/index.lock).
(e.g http://jenkins-ci.361315.n4.nabble.com/Git-index-lock-problem-on-a-common-directory-td4488918.html)
This change resolves this problem by rethrowing IOException on lock failure to make operation retryable.

Refs: jenkinsci/git-client-plugin#31, jenkinsci/git-client-plugin#17

@cloudbees-pull-request-builder

plugins » git-plugin #155 FAILURE
Looks like there's a problem with this pull request

@mshibuya
Copy link
Contributor Author

mshibuya commented Nov 1, 2013

The build failed, but it should not be my fault.
It's because f6d42c4 has changed git-client dependency to 1.4.7-SNAPSHOT and CI can't pick it up.

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@cloudbees-pull-request-builder

plugins » git-plugin #162 SUCCESS
This pull request looks good

@mshibuya
Copy link
Contributor Author

@ndeloof Do you have any opinion on this?

@ndeloof
Copy link
Contributor

ndeloof commented Nov 26, 2013

My sole concern is that with this change we consider all GitException during checkout to be retryable, even some may be a fatal error. Should only consider a well identified subset, maybe based on root exception message.

@mshibuya
Copy link
Contributor Author

It makes sense, indeed.
Then how do you think about creating an exception class

public class GitLockFailedException extends GitException {}

in git-client-plugin and catching it selectively on git-plugin side?

@cloudbees-pull-request-builder

plugins » git-plugin #197 FAILURE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

plugins » git-plugin #211 UNSTABLE
Looks like there's a problem with this pull request

@cloudbees-pull-request-builder

plugins » git-plugin #223 SUCCESS
This pull request looks good

@cloudbees-pull-request-builder

plugins » git-plugin #230 UNSTABLE
Looks like there's a problem with this pull request

@mshibuya
Copy link
Contributor Author

@ndeloof Any thoughts?

ndeloof added a commit that referenced this pull request Jan 28, 2014
@ndeloof ndeloof merged commit 26af80f into jenkinsci:master Jan 28, 2014
@mshibuya
Copy link
Contributor Author

Great thanks!

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.

4 participants