Skip to content
Permalink
Browse files

[JENKINS-46259] - Log all linkage errors during user requests (#186)

Log all linkage errors during user requests
  • Loading branch information...
olivergondza authored and oleg-nenashev committed Aug 17, 2017
1 parent 967bd94 commit 15e28c2a97fac29fd1eab2d8ef62ed82f4507766
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/main/java/hudson/remoting/UserRequest.java
@@ -51,6 +51,8 @@
*/
final class UserRequest<RSP,EXC extends Throwable> extends Request<UserResponse<RSP,EXC>,EXC> {

private static final Logger LOGGER = Logger.getLogger(UserRequest.class.getName());

private final byte[] request;

@Nonnull
@@ -180,7 +182,7 @@ public void checkIfCanBeExecutedOnChannel(Channel channel) throws IOException {
try {
o = deserialize(channel,request,cl);
} catch (ClassNotFoundException e) {
throw new ClassNotFoundException("Failed to deserialize the Callable object. Perhaps you needed to implement DelegatingCallable?",e);
throw new ClassNotFoundException("Failed to deserialize the Callable object. Perhaps you needed to implement DelegatingCallable?", e);
} catch (RuntimeException e) {
// if the error is during deserialization, throw it in one of the types Channel.call will
// capture its call site stack trace. See
@@ -204,6 +206,9 @@ public void checkIfCanBeExecutedOnChannel(Channel channel) throws IOException {
} finally {
Thread.currentThread().setContextClassLoader(old);
}
} catch (LinkageError e) {
LOGGER.log(Level.WARNING, "LinkageError while performing " + toString(), e);
throw e;
} finally {
Channel.setCurrent(oldc);
}

0 comments on commit 15e28c2

Please sign in to comment.
You can’t perform that action at this time.