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

Suppress some uninteresting stack traces when channel is closed #535

Merged
merged 1 commit into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/main/java/hudson/remoting/JarCacheSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,21 @@ public void run() {
LOGGER.log(Level.WARNING, String.format("Interrupted while resolving a jar %016x%016x", sum1, sum2), e);
Thread.currentThread().interrupt();
} catch (Throwable e) {
// in other general failures, we aren't retrying
// TODO: or should we?
promise.set(e);

LOGGER.log(Level.WARNING, String.format("Failed to resolve a jar %016x%016x", sum1, sum2), e);
if (channel.isClosingOrClosed()) {
bailout(e);
} else {
// in other general failures, we aren't retrying
// TODO: or should we?
promise.set(e);
LOGGER.log(Level.WARNING, String.format("Failed to resolve a jar %016x%016x", sum1, sum2), e);
}
}
}

/**
* Report a failure of the retrieval and allows another thread to retry.
*/
private void bailout(Exception e) {
private void bailout(Throwable e) {
inprogress.remove(key); // this lets another thread to retry later
promise.set(e); // then tell those who are waiting that we aborted
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/remoting/UserRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ protected ResponseToUserRequest<RSP,EXC> perform(Channel channel) throws EXC {
Thread.currentThread().setContextClassLoader(old);
}
} catch (LinkageError e) {
LOGGER.log(Level.WARNING, "LinkageError while performing " + toString(), e);
LOGGER.log(channel.isClosingOrClosed() ? Level.FINE : Level.WARNING, "LinkageError while performing " + toString(), e);
throw e;
} finally {
Channel.setCurrent(oldc);
Expand Down