which extension should I used to change stopping job?

11 views
Skip to first unread message

Brute

unread,
Mar 29, 2012, 5:24:43 AM3/29/12
to Jenkins Developers
I want to build a Jenkins plugin to add some actions when I click the
x button of a running job (to stop/cancel it).

which extension should I used or is there existed plugin I can used?
( I try to use and learn from signal_killer plugin, but seems it is
not what I want...)

Thank you~

Emanuele Zattin

unread,
Mar 29, 2012, 9:32:24 AM3/29/12
to jenkin...@googlegroups.com
Probably one of the listeners (RunListener maybe?) is what you're looking for.

BR,

Emanuele Zattin
---------------------------------------------------
-I don't have to know an answer. I don't feel frightened by not knowing things; by being lost in a mysterious universe without any purpose — which is the way it really is, as far as I can tell, possibly. It doesn't frighten me.- Richard Feynman

Brute

unread,
Mar 30, 2012, 9:57:45 PM3/30/12
to Jenkins Developers
I try it but it is seems not what I want...

my case is when the job is running and I want to stop it but failed (I
only can kill the process by hand to stop it), so I want to write
something when I click the X button.

RunListener just has started, completed, finalized and deleted. I
think I need a method which will be called between started and
completed when I click the X button.

I check the source code of Run.class but there are many catch, I am
not sure which it will go...(AbortException or RunnerAbortedException
or InterruptedException)...

BR/Brute
> > Thank you~- Hide quoted text -
>
> - Show quoted text -

Brute

unread,
Mar 31, 2012, 4:34:40 AM3/31/12
to Jenkins Developers
When I click the X button, the cmd (I run it in windows) shows:

java.lang.InterruptedException
at java.lang.ProcessImpl.waitFor(ProcessImpl.java:254)
at hudson.Proc$LocalProc.join(Proc.java:319)
at hudson.Launcher$ProcStarter.join(Launcher.java:345)
at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:82)
at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
at hudson.tasks.BuildStepMonitor
$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild
$AbstractRunner.perform(AbstractBuild.java:
697)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild
$AbstractRunner.run(AbstractBuild.java:467)

at hudson.model.Run.run(Run.java:1404)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at
hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)

Is it normal?

I find the codes in hudson.Proc.class like:

catch (InterruptedException e) {
// aborting. kill the process
destroy();
throw e;
}

and destroy() should call kill() which extends ProcessKiller (used in
signal_killer plugin) finally but doesn't.

any suggestion? Thank you~
> > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages