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

Add checkout attempts for stability and fix minor issues #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SOVALINUX
Copy link

  1. Add checkout attempts, since stats showed it can be very unstable regarding of network
  2. Fix pom and resource versions

@SOVALINUX
Copy link
Author

I was thinking about adding checkout property to configuration form, bit not sure, that this is really useful functionality

@ashwanthkumar
Copy link
Owner

@SOVALINUX Sorry for not getting back sooner. Can you shed some more light on this change? What was the scenario you observed and how this fix helps?

@SOVALINUX
Copy link
Author

In my logs were a lot of errors that material checkout failed, since git fetch command returned exit code 1 or 128. As I said above it may be caused by network problems. After applying this fix locally it became much better.
Actually this fix is a bit dirty. Better to add checkout timeout for 10 minutes for example. And within this timeout there might be several attempts

@@ -249,22 +251,27 @@ private GoPluginApiResponse handleCheckout(GoPluginApiRequest goPluginApiRequest
String destinationFolder = (String) requestBodyMap.get("destination-folder");
Map<String, Object> revisionMap = (Map<String, Object>) requestBodyMap.get("revision");
String revision = (String) revisionMap.get("revision");
LOGGER.info(String.format("destination: %s. commit: %s", destinationFolder, revision));
for (int attempt = 0; attempt < CHECKOUT_ATTEMPTS; attempt++) {
LOGGER.info(String.format("destination: %s. commit: %s, attempt: %s", destinationFolder, revision, attempt));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add attempt count as part of the log? It helps while debugging.

@ashwanthkumar
Copy link
Owner

Thanks @SOVALINUX. If you could just fix the conflicts, I would merge the changes.

Conflicts:
	src/main/java/in/ashwanthkumar/gocd/github/GitHubPRBuildPlugin.java
	src/main/resources/gerrit/plugin.xml
	src/main/resources/git/plugin.xml
	src/main/resources/github/plugin.xml
	src/main/resources/stash/plugin.xml
@gregoryfischer
Copy link

gregoryfischer commented Apr 2, 2020

@ashwanthkumar - Were the ongoing issues of 128 errors addressed in other PRs or versions that this attempted to address but died on the vine in 2015.

Related to #144 and #118

@MPV
Copy link

MPV commented May 24, 2023

Any news on this?

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