Fwd: Possible to prevent execution of a job during certain time periods?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Possible to prevent execution of a job during certain time periods?

Matt Brown
Hello dev list,

Does the following behavior that I describe below sound like it would be useful in Hudson (as a plugin)? Or is something that sounds so localized to my environment that others might not find it useful at all?

I have some free time next week and was contemplating investigating how I might implement this behavior as a Hudson plugin - I've been saying for a while about how I wanted to learn how to write plugins and contribute code.

But would this feature even be useful/desired?

Thanks
Matt

---------- Forwarded message ----------
From: Matt Brown <[hidden email]>
Date: Thu, Nov 19, 2009 at 1:39 PM
Subject: Possible to prevent execution of a job during certain time periods?
To: [hidden email]


One of my jobs executes Canoo Webtests against a webapp deployed on an internal Tomcat server.

To avoid periodic PermGen memory issues caused by applications being redeployed constantly to this Tomcat, we have a cron job that simply restarts this server every hour.

Is there any way or plugin for Hudson that will prevent the Webtest job from being executed during a certain block of time? For example, I'd like to tell Hudson "don't start this job between the :25 and :35 minute mark". If any builds of the job are triggered during this time period, I'd want Hudson to not start executing the build until the :35 minute mark is reached.

In other words I'd like to have something similar to the "quiet period" after a build is triggered that instead of waiting X seconds just prevents execution during a configured time range.



Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Possible to prevent execution of a job during certain time periods?

Fabrizio Giudici
Matt Brown wrote:

> Hello dev list,
>
> Does the following behavior that I describe below sound like it would
> be useful in Hudson (as a plugin)? Or is something that sounds so
> localized to my environment that others might not find it useful at all?
>
> I have some free time next week and was contemplating investigating
> how I might implement this behavior as a Hudson plugin - I've been
> saying for a while about how I wanted to learn how to write plugins
> and contribute code.
>
> But would this feature even be useful/desired?
Definitely useful. I don't have any restart issue, but I'd like to
create a job for automating the backup of Hudson and its workspaces, and
of course it would be much better if it happened when nothing is running.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/people
[hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Possible to prevent execution of a job during certain time periods?

Alan Harder-2
If the job runs on a particular slave node you could run Hudson with
-Dhudson.scheduledRetention=true and try that to keep the slave offline
when you don't want the job to run.
Or, you could use Locks&Latches plugin and have a "blocker" job that
grabs a lock and just sleeps for a while to block the other job from
running in those times.

    - Alan


Fabrizio Giudici wrote:

> Matt Brown wrote:
>> Hello dev list,
>>
>> Does the following behavior that I describe below sound like it would
>> be useful in Hudson (as a plugin)? Or is something that sounds so
>> localized to my environment that others might not find it useful at all?
>>
>> I have some free time next week and was contemplating investigating
>> how I might implement this behavior as a Hudson plugin - I've been
>> saying for a while about how I wanted to learn how to write plugins
>> and contribute code.
>>
>> But would this feature even be useful/desired?
> Definitely useful. I don't have any restart issue, but I'd like to
> create a job for automating the backup of Hudson and its workspaces,
> and of course it would be much better if it happened when nothing is
> running.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Possible to prevent execution of a job during certain time periods?

Fabrizio Giudici
Alan Harder wrote:
> If the job runs on a particular slave node you could run Hudson with
> -Dhudson.scheduledRetention=true and try that to keep the slave
> offline when you don't want the job to run.
> Or, you could use Locks&Latches plugin and have a "blocker" job that
> grabs a lock and just sleeps for a while to block the other job from
> running in those times.
>
Sure. But if Matt wishes to write a plugin, I'd be more pleased to just
mark a checkbox and enter a hour range in another field. Hudson is
great, but it's already requiring a number of hacks for making my
multi-stage work (half-work), so the more hacks can be avoided, the better.

--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/people
[hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Possible to prevent execution of a job during certain time periods?

Matt Brown
Can anyone offer some tips as to where I might begin as far as implementing this plugin idea?

I've been looking at the Extension list and I don't see any that seem to apply.

I've also been looking at the Queue class, thinking that I could perhaps tweak some logic somewhere to extend the quiet period of any job during this "prevent execution window" - so that these jobs will stay in the Queue.waitingList during this "don't execute" window - but it seems as if this might not be a good option as a number of other classes schedule builds directly with a certain value for the quietPeriod.

Thanks
Matt


On Fri, Nov 20, 2009 at 2:26 PM, Fabrizio Giudici <[hidden email]> wrote:
Alan Harder wrote:
If the job runs on a particular slave node you could run Hudson with -Dhudson.scheduledRetention=true and try that to keep the slave offline when you don't want the job to run.
Or, you could use Locks&Latches plugin and have a "blocker" job that grabs a lock and just sleeps for a while to block the other job from running in those times.

Sure. But if Matt wishes to write a plugin, I'd be more pleased to just mark a checkbox and enter a hour range in another field. Hudson is great, but it's already requiring a number of hacks for making my multi-stage work (half-work), so the more hacks can be avoided, the better.


--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/people
[hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Possible to prevent execution of a job during certain time periods?

Alan Harder-2
Coding something along the lines of the Locks&Latches solution I
mentioned would work.. add something to a job so it needs to get a
particular Resource to run.  Then your plugin would have something in
the background that locks that resource during certain time periods.

    - Alan


Matt Brown wrote:

> Can anyone offer some tips as to where I might begin as far as
> implementing this plugin idea?
>
> I've been looking at the Extension list and I don't see any that seem
> to apply.
>
> I've also been looking at the Queue class, thinking that I could
> perhaps tweak some logic somewhere to extend the quiet period of any
> job during this "prevent execution window" - so that these jobs will
> stay in the Queue.waitingList during this "don't execute" window - but
> it seems as if this might not be a good option as a number of other
> classes schedule builds directly with a certain value for the quietPeriod.
>
> Thanks
> Matt
>
>
> On Fri, Nov 20, 2009 at 2:26 PM, Fabrizio Giudici
> <[hidden email] <mailto:[hidden email]>>
> wrote:
>
>     Alan Harder wrote:
>
>         If the job runs on a particular slave node you could run
>         Hudson with -Dhudson.scheduledRetention=true and try that to
>         keep the slave offline when you don't want the job to run.
>         Or, you could use Locks&Latches plugin and have a "blocker"
>         job that grabs a lock and just sleeps for a while to block the
>         other job from running in those times.
>
>     Sure. But if Matt wishes to write a plugin, I'd be more pleased to
>     just mark a checkbox and enter a hour range in another field.
>     Hudson is great, but it's already requiring a number of hacks for
>     making my multi-stage work (half-work), so the more hacks can be
>     avoided, the better.
>
>
>     --
>     Fabrizio Giudici - Java Architect, Project Manager
>     Tidalwave s.a.s. - "We make Java work. Everywhere."
>     weblogs.java.net/blog/fabriziogiudici
>     <http://weblogs.java.net/blog/fabriziogiudici> -
>     www.tidalwave.it/people <http://www.tidalwave.it/people>
>     [hidden email] <mailto:[hidden email]>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: [hidden email]
>     <mailto:[hidden email]>
>     For additional commands, e-mail: [hidden email]
>     <mailto:[hidden email]>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]