Issue Details (XML | Word | Printable)

Key: CONTINUUM-2195
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jose Morales Martinez
Reporter: Brett Porter
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Continuum

adding a new schedule does not work on first activation

Created: 22/Apr/09 06:00 AM   Updated: 01/Jun/09 12:28 PM   Resolved: 01/Jun/09 12:28 PM
Return to search
Component/s: Core system
Affects Version/s: 1.3.3
Fix Version/s: 1.3.4, 1.4.0

Time Tracking:
Not Specified

Complexity: Intermediate


 Description  « Hide

When the schedule was first created (with no projects assigned), it was "activated". However, after assigning a project to it, it did not fire. Editing the schedule (no changes made), caused it to fire on the assigned project. The log is as follows:

2009-04-22 20:03:51,005 [btpool0-1] INFO  org.apache.maven.continuum.build.settings.DefaultSchedulesActivator  - Activating schedule minutely
2009-04-22 20:37:13,488 [btpool0-7] INFO  org.apache.maven.continuum.build.settings.DefaultSchedulesActivator  - Deactivating schedule minutely
2009-04-22 20:37:13,488 [btpool0-7] INFO  org.apache.maven.continuum.build.settings.DefaultSchedulesActivator  - Stopping active schedule "minutely".
2009-04-22 20:37:13,488 [btpool0-7] INFO  org.apache.maven.continuum.build.settings.DefaultSchedulesActivator  - Activating schedule minutely
2009-04-22 20:37:13,494 [btpool0-7] INFO  org.apache.maven.continuum.build.settings.DefaultSchedulesActivator  - minutely: next fire time ->Wed Apr 22 20:38:00 EST 2009
2009-04-22 20:38:00,019 [continuumScheduler_Worker-4] INFO  org.apache.maven.continuum.build.settings.DefaultSchedulesActivator  - >>>>>>>>>>>>>>>>>>>>> Executing build job (minutely)...


Jose Morales Martinez added a comment - 18/May/09 12:27 PM

Actually Continuum add a schedule is associated with a buildDefinition or purge process. Then you need an enable disable previously if it was not associated with a project. I think there are two possible solutions:
1.- When whe updated or add a new build definition or purge process we would check if associated schedule jobs is in queuue (pending to execute) and enable/disable it.
2.- Always (active = true) enqueue 2 jobs, first for buildProcess and second for purge process. They check if there are associated elements to execute process.

What solution do you think is better?


Wendy Smoak added a comment - 18/May/09 02:56 PM

without looking at the code, I'm leaning towards ...

3. Move the code that "checks" somewhere it can be shared between (1) and (2)

As written,
(1) sounds to me like it will add a duplicate check
(2) sounds like you're relying on a side effect of some other process, which will be confusing


Jose Morales Martinez added a comment - 18/May/09 05:04 PM

Sorry, but I think I have not explained:
Currently only when we enable a schedule we add a job to scheduler(application scheduler- quartz ). Performing the following checks:

if ( isScheduleFromBuildJob( schedule ) )
{
  // A buildDefinition with this schedule
  schedule( schedule, continuum, ContinuumBuildJob.class );
}

if ( isScheduleFromPurgeJob( schedule ) )
{
  // A purge with this schedule
  schedule( schedule, continuum, ContinuumPurgeJob.class );
}

That way if the schedule is not linked to a buildDefinition or purgeConfiguration not work for them. After set a schedule for a buildDefinition/purgeConfiguration we need to update the schedule to add job(s) to application scheduler.

In this way, my options are:
1 - Always add the job (buildDefinition and purgeConfiguration) to the scheduler. Simpler and does not modify the code to buildDefinition and purgeConfiguration
2 - When a store purgeConfiguration / buildDefinition set a schedule we add job to application scheduler. More efficient (the scheduler only contains the jobs to be executed)
3 - Add a single job for application scheduler and its execution launch a thread for builds and other for purge. This solution is similar to the first.


Maria Catherine Tan added a comment - 19/May/09 08:33 PM

I think i'll go with [2].

After setting a schedule on a purgeConfiguration or buildDefinition, we add another call to schedule the job.

Same goes when unsetting a schedule on purgeConfiguration/buildDefinition, scheduled job should be removed.


Jose Morales Martinez added a comment - 01/Jun/09 12:28 PM

Fixed in :

r780709 of branch 1.3.x
r780735 of version 1.4.0