Bug 735087 - Non-unique job names breaks clustered Pinsetter.
Summary: Non-unique job names breaks clustered Pinsetter.
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Jesus M. Rodriguez
QA Contact: John Sefler
Depends On:
TreeView+ depends on / blocked
Reported: 2011-09-01 12:24 UTC by Brenton Leanhardt
Modified: 2015-05-14 15:22 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-07-17 13:04:03 UTC

Attachments (Terms of Use)

Description Brenton Leanhardt 2011-09-01 12:24:08 UTC
Description of problem:

We have setup a cluster of Candlepins to use the same quartz database (mysql).  When we launch Tomcat we get lots of stack traces similar to the following:

Caused by: org.quartz.ObjectAlreadyExistsException: Unable to store Job with name: 'org.fedoraproject.candlepin.pinsett
er.tasks.JobCleaner-1' and group: 'cron group', because one already exists with this identification.
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1093)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport$3.execute(JobStoreSupport.java:1042)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport$40.execute(JobStoreSupport.java:3670)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3742)
        at org.quartz.impl.jdbcjobstore.JobStoreTX.executeInLock(JobStoreTX.java:90)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3666)
        at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobAndTrigger(JobStoreSupport.java:1030)
        at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:743)
        at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:243)
        at org.fedoraproject.candlepin.pinsetter.core.PinsetterKernel.scheduleJob(PinsetterKernel.java:274)
        ... 30 more

Version-Release number of selected component (if applicable):

Additional info:
We talked with Jesus and a unique string needs to be added to the job names to work around this issue.

Comment 1 Brenton Leanhardt 2011-09-06 16:23:45 UTC
Any word on this?

Comment 3 Jesus M. Rodriguez 2011-09-07 18:28:13 UTC
fixed in master by 96cd75214f5699151f8567b13e5ac51264ac6c05

Comment 4 Jesus M. Rodriguez 2011-09-07 18:28:22 UTC
If quartz is in clustered mode, we shouldn't schedule any jobs.

    Doing so will cause a primary key violation on the second
    Candlepin node. The primary key for the table is:
    trigger name + trigger group.

    At first I believed it was that we weren't using unique enough
    names. The name collision was a red herring, the real problem
    is we don't want to create new jobs when in clustered mode.
    We now check to see if quartz is in clustered mode, and if there
    are any jobs already scheduled from another node. If not, we
    proceed to schedule the jobs as normal. Otherwise, we skip
    initialization of the jobs and join the existing cluster.

    Added getClassName(String) to Util.
    Updated unit tests.

Comment 6 Bryan Kearney 2012-07-17 13:04:03 UTC
Marking all community bugs modified or beyong as closed.

Note You need to log in before you can comment on or make changes to this bug.