Source:
protected Future<?> _connect(boolean forceReconnect) { if(channel!=null) return Futures.precomputed(null); if(!forceReconnect && isConnecting()) return lastConnectActivity; if(forceReconnect && isConnecting()) logger.fine("Forcing a reconnect on "+getName()); closeChannel(); Exception threadInfo = new Exception(); return lastConnectActivity = Computer.threadPoolForRemoting.submit(() -> { try (ACLContext ctx = ACL.as(ACL.SYSTEM)) { log.rewind(); try { for (ComputerListener cl : ComputerListener.all()) cl.preLaunch(SlaveComputer.this, taskListener); 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; } } finally { if (channel==null && offlineCause == null) { offlineCause = new OfflineCause.LaunchFailed(); for (ComputerListener cl : ComputerListener.all()) cl.onLaunchFailure(SlaveComputer.this, taskListener); } } if (channel==null) throw new IOException("Agent failed to connect, even though the launcher didn't report it. See the log output for details."); return null; }); }

Target:
protected Future<?> _connect(boolean forceReconnect) { if(channel!=null) return Futures.precomputed(null); if(!forceReconnect && isConnecting()) return lastConnectActivity; if(forceReconnect && isConnecting()) logger.fine("Forcing a reconnect on "+getName()); closeChannel(); Throwable threadInfo = new Throwable("launched here"); return lastConnectActivity = Computer.threadPoolForRemoting.submit(() -> { try (ACLContext ctx = ACL.as(ACL.SYSTEM)) { log.rewind(); try { for (ComputerListener cl : ComputerListener.all()) cl.preLaunch(SlaveComputer.this, taskListener); 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; } } finally { if (channel==null && offlineCause == null) { offlineCause = new OfflineCause.LaunchFailed(); for (ComputerListener cl : ComputerListener.all()) cl.onLaunchFailure(SlaveComputer.this, taskListener); } } if (channel==null) throw new IOException("Agent failed to connect, even though the launcher didn't report it. See the log output for details."); return null; }); }