Skip to content

framework: do not double-execute an async job after returning its queue item - #14039

Open
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:fix/asyncjob-double-execution
Open

framework: do not double-execute an async job after returning its queue item#14039
nagaboinaramgopal wants to merge 1 commit into
apache:mainfrom
nagaboinaramgopal:fix/asyncjob-double-execution

Conversation

@nagaboinaramgopal

Copy link
Copy Markdown

Description

In executeQueueItem, when persisting the executing management-server id fails
(the DB-deadlock case the catch block exists for), the queue item is returned to
the queue so it can be retried later. Execution then fell through to
scheduleExecution(job), so the job was dispatched now AND re-dequeued and
dispatched again by the heartbeat, running the same job (VM start/deploy, volume
create, snapshot, etc.) twice concurrently and defeating the sync queue's
serialization.

Return after returning the item so the job runs once, on the retry.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • Minor

How Has This Been Tested?

Added a unit test that makes the executing-msid update throw and asserts the
queue item is returned and the job is not also scheduled. Also built the standard
packages and deployed on a KVM advanced zone.

…ue item

In executeQueueItem, when persisting the executing MS id fails (the DB-deadlock
case the catch block exists for), the queue item is returned to the queue so it
can be retried. Execution then fell through to scheduleExecution(job), so the job
was dispatched now AND re-dequeued and dispatched again by the heartbeat, running
the same job (VM start/deploy, volume create, snapshot, etc.) twice concurrently
and defeating the sync queue's serialization. Return after returning the item.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant