if (SHOW_PID) { ProcessTree.OSProcess p = ProcessTree.get().get(proc); t.setName(oldName+" "+(p!=null?"waiting for pid="+p.getPid():"waiting for "+name));
@Override public String call() throws IOException { for (ProcessKillingVeto vetoExtension : ProcessKillingVeto.all()) { VetoCause cause = vetoExtension.vetoProcessKilling(process); if (cause != null) { if (LOGGER.isLoggable(FINEST)) LOGGER.info("Killing of pid " + getPid() + " vetoed by " + vetoExtension.getClass().getName() + ": " + cause.getMessage()); return cause.getMessage(); } } return null; } }
@Override public void killAll(Map<String, String> modelEnvVars) throws InterruptedException { for( OSProcess p : this) { if(p.getPid()<10) continue; // ignore system processes like "idle process" LOGGER.log(FINEST, "Considering to kill {0}", p.getPid()); boolean matched; try { matched = hasMatchingEnvVars(p, modelEnvVars); } catch (WindowsOSProcessException e) { // likely a missing privilege // TODO: not a minor issue - causes process termination error in JENKINS-30782 if (LOGGER.isLoggable(FINEST)) { LOGGER.log(FINEST, "Failed to check environment variable match for process with pid=" + p.getPid() ,e); } continue; } if(matched) { p.killRecursively(); } else { LOGGER.log(Level.FINEST, "Environment variable didn't match for process with pid={0}", p.getPid()); } } }
public void killAll(Map<String, String> modelEnvVars) throws InterruptedException { for (OSProcess p : this) { if (p.getPid() < 10) { continue; // ignore system processes like "idle process" } boolean matched; try { matched = p.hasMatchingEnvVars(modelEnvVars); } catch (NativeAccessException e) { // likely a missing privilege logger.debug( " Failed to check environment variable match", e); continue; } if (matched) { logger.debug("Killing process started by build " + p.getPid()); p.killRecursively(); } } } }
public void killAll(Map<String, String> modelEnvVars) throws InterruptedException { for( OSProcess p : this) { if(p.getPid()<10) continue; // ignore system processes like "idle process" LOGGER.finest("Considering to kill "+p.getPid()); boolean matched; try { matched = p.hasMatchingEnvVars(modelEnvVars); } catch (WinpException e) { // likely a missing privilege LOGGER.log(FINEST," Failed to check environment variable match",e); continue; } if(matched) p.killRecursively(); else LOGGER.finest("Environment variable didn't match"); } }
public void killAll(Map<String, String> modelEnvVars) throws InterruptedException { for (OSProcess p : this) { if (p.getPid() < 10) { continue; // ignore system processes like "idle process" } boolean matched; try { matched = p.hasMatchingEnvVars(modelEnvVars); } catch (NativeAccessException e) { // likely a missing privilege logger.debug(" Failed to check environment variable match", e); continue; } if (matched) { logger.debug("Killing process started by build " + p.getPid()); p.killRecursively(); } } } }
public void killAll(Map<String, String> modelEnvVars) throws InterruptedException { for( OSProcess p : this) { if(p.getPid()<10) continue; // ignore system processes like "idle process" LOGGER.finest("Considering to kill "+p.getPid()); boolean matched; try { matched = p.hasMatchingEnvVars(modelEnvVars); } catch (WinpException e) { // likely a missing privilege LOGGER.log(FINEST," Failed to check environment variable match",e); continue; } if(matched) p.killRecursively(); else LOGGER.finest("Environment variable didn't match"); } }
/** * @return The first non-null {@link VetoCause} provided by a process killing veto extension for this OSProcess. * null if no one objects killing the process. */ protected @CheckForNull VetoCause getVeto() { for (ProcessKillingVeto vetoExtension : ProcessKillingVeto.all()) { VetoCause cause = vetoExtension.vetoProcessKilling(this); if (cause != null) { if (LOGGER.isLoggable(FINEST)) LOGGER.finest("Killing of pid " + getPid() + " vetoed by " + vetoExtension.getClass().getName() + ": " + cause.getMessage()); return cause; } } return null; }
RemoteProcess(OSProcess proxy, Channel ch) { super(proxy.getPid()); this.proxy = ch.export(IOSProcess.class,proxy); }
RemoteProcess(OSProcess proxy, Channel ch) { super(proxy.getPid()); this.proxy = ch.export(IOSProcess.class,proxy); }
RemoteProcess(OSProcess proxy, Channel ch) { super(proxy.getPid()); this.proxy = ch.export(IOSProcess.class, proxy); }
RemoteProcess(OSProcess proxy, Channel ch) { super(proxy.getPid()); this.proxy = ch.export(IOSProcess.class,proxy); }
RemoteProcess(OSProcess proxy, Channel ch) { super(proxy.getPid()); this.proxy = ch.export(IOSProcess.class,proxy); }
void killByKiller() throws InterruptedException { for (ProcessKiller killer : getKillers()) { try { if (killer.kill(this)) { break; } } catch (IOException e) { logger.info("Failed to kill the process started by process - " + getPid(), e); } } }
void killByKiller() throws InterruptedException { for (ProcessKiller killer : getKillers()) try { if (killer.kill(this)) break; } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to kill pid="+getPid(),e); } }
void killByKiller() throws InterruptedException { for (ProcessKiller killer : getKillers()) try { if (killer.kill(this)) break; } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to kill pid="+getPid(),e); } }
void killByKiller() throws InterruptedException { for (ProcessKiller killer : getKillers()) try { if (killer.kill(this)) break; } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to kill pid="+getPid(),e); } }
void killByKiller() throws InterruptedException { for (ProcessKiller killer : getKillers()) try { if (killer.kill(this)) break; } catch (IOException e) { logger.info("Failed to kill the process started by process - "+getPid(),e); } }
RemoteProcess(OSProcess proxy, Channel ch) { super(proxy.getPid()); this.proxy = ch.export(IOSProcess.class,proxy); }
void killByKiller() throws InterruptedException { for (ProcessKiller killer : getKillers()) try { if (killer.kill(this)) { break; } } catch (IOException | Error e) { LOGGER.log(Level.WARNING, "Failed to kill pid=" + getPid(), e); } }