-
Notifications
You must be signed in to change notification settings - Fork 135
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
[FIX JENKINS-52739] set default values for retries and timeout settings #92
Conversation
relaunch CI |
@@ -866,7 +881,7 @@ public Boolean call() throws InterruptedException { | |||
Boolean res; | |||
try { | |||
res = results.get(0).get(); | |||
} catch (ExecutionException e) { | |||
} catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CancelException is not treated, probably more, it breaks the retries logic, by catching the Exception the CancelException is treated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I doubt someone really needs this to wait forever. Integer range is big enough for a couple of decades worth of seconds for launch to timeout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got a concern about catching Throwable but other than that it looks good.
@@ -866,8 +881,11 @@ public Boolean call() throws InterruptedException { | |||
Boolean res; | |||
try { | |||
res = results.get(0).get(); | |||
} catch (ExecutionException e) { | |||
} catch (Throwable e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little concerned about catching Throwable here. It's not generally a good idea. Is this one of those few places where Throwable makes sense? Would it be better to narrow it down to not catch catastrophic failures?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I will try to figure out which exceptions could be throw here, the main issue here is, if the exception is not catched, the retries start again from the max number of retries.
@@ -141,6 +142,9 @@ | |||
private static final List<String> RECOVERABLE_FAILURES = Arrays.asList( | |||
"Connection refused", "Connection reset", "Connection timed out", "No route to host", "Premature connection close" | |||
); | |||
public static final Integer DEFAULT_MAX_NUM_RETRIES = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense to use int
here? The member fields can be nullable, but these constants certainly aren't, and autoboxing will be performed regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna check it because I have changed it due findbugs errors related to boxing-unboxing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the reason why I set the constants as Integer
At SSHLauncher.java:[line 1439] BX_UNBOXING_IMMEDIATELY_REBOXED
public Integer getMaxNumRetries() {
return maxNumRetries == null || maxNumRetries < 0 ? DEFAULT_MAX_NUM_RETRIES : maxNumRetries;
}
I can change it to but it is ugly to transform something can be and Integer, I preferred to avoid the transformation.
public Integer getMaxNumRetries() {
return maxNumRetries == null || maxNumRetries < 0 ? Integer.valueOf(DEFAULT_MAX_NUM_RETRIES) : maxNumRetries;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, no worries. This would require changing far more signatures clearly; not worth it.
@@ -1415,7 +1434,7 @@ private long getLaunchTimeoutMillis() { | |||
* @return maxNumRetries | |||
*/ | |||
public Integer getMaxNumRetries() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you stuck with API compatibility here, or can you change these getters to use an int
instead? Or add @NonNull
to them at least? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
res = Boolean.FALSE; | ||
System.out.println(e.getMessage()); | ||
listener.getLogger().println("ECHO"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like forgotten debugging statements...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, it is removed on latest commit ;)
You've got a typo in the title, otherwise all good. |
JENKINS-52739