provider: fix instance managers wedging on dropped watcher events#823
Open
benoit-nexthop wants to merge 1 commit into
Open
provider: fix instance managers wedging on dropped watcher events#823benoit-nexthop wants to merge 1 commit into
benoit-nexthop wants to merge 1 commit into
Conversation
Instance managers acted solely on an in-memory copy of the instance, updated only via watcher events. consolidateState() held the manager mutex across provider calls and backoff sleeps (up to minutes), which starved handleUpdate() and caused Update() to drop events after its 10s send timeout. If the dropped event was the transition back to pending_delete after a failed provider delete, the manager was left with a stale "deleting" status - which consolidateState had no case for - and idled forever while the runner stayed in pending_delete for days. - consolidateState no longer holds the mutex for its duration; it works on a snapshot via new getInstance()/setInstance() accessors. - Reconcile against the database on every tick via the new helper GetInstance(), so a dropped event can no longer permanently wedge a manager. A missing row exits the manager cleanly. - Handle InstanceDeleting as an interrupted delete and retry it with the normal backoff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instance managers acted solely on an in-memory copy of the instance, updated only via watcher events.
consolidateState()held the manager mutex across provider calls and backoff sleeps (up to minutes), which starvedhandleUpdate()and causedUpdate()to drop events after its 10s send timeout. If the dropped event was the transition back topending_deleteafter a failed provider delete, the manager was left with a stale "deleting" status - whichconsolidateStatehad no case for - and idled forever while the runner stayed inpending_deletefor days.consolidateStateno longer holds the mutex for its duration; it works on a snapshot via newgetInstance()/setInstance()accessors.GetInstance(), so a dropped event can no longer permanently wedge a manager. A missing row exits the manager cleanly.InstanceDeletingas an interrupted delete and retry it with the normal backoff.