How to disable a trigger when job is disabled

142 views
Skip to first unread message

Xav

unread,
Aug 5, 2011, 11:26:34 AM8/5/11
to Jenkins Developers
Hi,

What ever the trigger i'm using (DOS Trigger, ScriptTrigger, URL
Trigger Plugin, File Found Trigger,...) the cron tab is still running
even if the job is disabled.

Does Jenkins should not manage this case ?

As a work around i'm looking for a way to disable the trigger when it
runs and when the job is diabled.


public void run() {
try {
// Job is disabled
if (((AbstractProject) job).isDisabled()) {
LOGGER.log(Level.INFO,"[Job " + ((AbstractItem)
job).getDisplayName() + "] - Job Disabled");

// What to do there?
// Changing the spec value ?
// Removing the trigger of the job ?

return;
}
...


I can't find other plugin managing this case.

Thanks for your help

Xav

Grégory Boissinot

unread,
Aug 7, 2011, 7:54:50 PM8/7/11
to jenkin...@googlegroups.com
I checked the code source of these plugins.
Only the File Found Trigger doesn't check if the job is disabled.
Therefore, are you sure you have this behavior with only one of the other trigger plugins configured?

Xavier DELAS

unread,
Aug 8, 2011, 5:05:28 AM8/8/11
to jenkin...@googlegroups.com
My concern is:

even if the job is disabled, the cron tab is still running.So it is consuming server resources for nothing.Do you think i should raise an issue for that - or do you think that is normal behavior ?

I agree that Dos Trigger or ScripTrigger are checking the job status at the run function entry but in my opinion the cron tab should be not running.

So i'm searching a way to disable it in this case.

Do you have any idea how to do that ?




2011/8/8 Grégory Boissinot <gregory....@gmail.com>

Grégory Boissinot

unread,
Aug 8, 2011, 5:59:04 AM8/8/11
to jenkin...@googlegroups.com
On Mon, Aug 8, 2011 at 11:05 AM, Xavier DELAS <xavier...@gmail.com> wrote:
My concern is:

even if the job is disabled, the cron tab is still running.So it is consuming server resources for nothing.Do you think i should raise an issue for that - or do you think that is normal behavior ?

I understand.
It isn't the expected behaviour.
However, I can't reproduce it and the plugins are supposed to not check changes when the build is disabled. 

I agree that Dos Trigger or ScripTrigger are checking the job status at the run function entry but in my opinion the cron tab should be not running.

So i'm searching a way to disable it in this case.

Do you have any idea how to do that ?


Could you do a test for a  job with only the ScriptTrigger plugin?
And if there is an issue, could you raise a ticket and provide your environment (plugin version, jenkins version, oss  an so on)? 
Reply all
Reply to author
Forward
0 new messages