mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 02:26:18 +00:00
Merge pull request #4754 from Vlatombe/capture-slavecomputer-threadinfo
Capture stacktrace from the original thread when SlaveComputer#_connect fails
This commit is contained in:
1 file changed
+5
@@ -283,6 +283,7 @@ public class SlaveComputer extends Computer {
|
||||
logger.fine("Forcing a reconnect on "+getName());
|
||||
|
||||
closeChannel();
|
||||
Throwable threadInfo = new Throwable("launched here");
|
||||
return lastConnectActivity = Computer.threadPoolForRemoting.submit(() -> {
|
||||
// do this on another thread so that the lengthy launch operation
|
||||
// (which is typical) won't block UI thread.
|
||||
@@ -295,16 +296,20 @@ public class SlaveComputer extends Computer {
|
||||
offlineCause = null;
|
||||
launcher.launch(SlaveComputer.this, taskListener);
|
||||
} catch (AbortException e) {
|
||||
e.addSuppressed(threadInfo);
|
||||
taskListener.error(e.getMessage());
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
e.addSuppressed(threadInfo);
|
||||
Util.displayIOException(e,taskListener);
|
||||
Functions.printStackTrace(e, taskListener.error(Messages.ComputerLauncher_unexpectedError()));
|
||||
throw e;
|
||||
} catch (InterruptedException e) {
|
||||
e.addSuppressed(threadInfo);
|
||||
Functions.printStackTrace(e, taskListener.error(Messages.ComputerLauncher_abortedLaunch()));
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
e.addSuppressed(threadInfo);
|
||||
Functions.printStackTrace(e, taskListener.error(Messages.ComputerLauncher_unexpectedError()));
|
||||
throw e;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user