Description of problem:
When dogfooding the Rules Engine, we found that some rules were been actioned twice (see bug 1128008).
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a rule that runs on job creation time
2. Have multiple job queues running
3. Create a bug
The rule appears to fire multiple times
The rule should run once.
The root cause of this is when creating a bug, both a 'create' and an 'update' job is created for the job. Since Red Hat have multiple job queues, they both ran at the same time (one on each server) and weren't aware that the other queue was also processing the bug.
There are two thing that should be fixed.
1) If possible, we should create a 'create' job only when creating a bug.
2) The above doesn't fix the problem where a bug is updated multiple times (e.g. two RPC calls, or if the job queue was disabled and two updates were done in quick succession). To handle that unlikely situation, we need to check that there is no lowered numbered (ts_job.id) job in the queue for the same bug, excluding dry runs (which don't change the bug).
(In reply to Simon Green from comment #0)
> There are two thing that should be fixed.
> 1) If possible, we should create a 'create' job only when creating a bug.
This cannot be done. Upstream code calls update after setting the bug flags.
This change is now live. If there are any issues, do not reopen this bug.
Instead, you should create a new bug and reference this bug.