-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(worker/broker): threads were killed prematurely
### Summary This is discussed in FTI-5930 and a workaround for this issue was proposed in: https://github.com/Kong/kong/pull/13004 Before (dbless node): 1. Worker 0 gets "reconfigure" event and acquires coroutine mutex 2. Worker 1 gets "reconfigure" event and acquires coroutine mutex 3. Worker 0 crashes and with it the events broker crashes too 4. Worker 1 restarts its events processing because of connection issue to events broker and it prematurely kills the executing "reconfigure" event handler as well, that then doesn't release its mutex. 5. Worker 0 restarts with pristine state (only the possible and time-outing node level locks are retained) 6. Worker 0 gets "reconfigure" event and acquires coroutine mutex 7. Worker 1 gets "reconfigure" event and is now in deadlock situation After (dbless node): 1. Worker 0 gets "reconfigure" event and acquires coroutine mutex 2. Worker 1 gets "reconfigure" event and acquires coroutine mutex 3. Worker 0 crashes and with it the events broker crashes too 4. Worker 1 restarts its events processing because of connection issue to events broker but it finishes the execution of an executing event handlers allowing the release of locks 5. Worker 0 restarts with pristine state (only the possible and time-outing node level locks are retained) 6. Worker 0 gets "reconfigure" event and acquires coroutine mutex 7. Worker 1 gets "reconfigure" event and acquires coroutine mutex
- Loading branch information
Showing
4 changed files
with
250 additions
and
260 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.