Race condition may make eventengine ignore events at random
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
High
|
Morten Brekkevold |
Bug Description
Sometimes, events are left in the eventq without the eventengine ever having touched them.
The eventengine keeps the id of the last handled event at all times, to avoid handling a postponed event multiple times. It seems there is a race condition which allows the eventengine to skip over some events when multiple events are posted at the same time.
The theorized situation is this:
Programs A and B each retrieve an event id from the database sequence, with 1 and 2 being their respective results.
Program B manages to commit event 2 before program A manages to commit event 1.
The eventengine checks the eventq, finds event 2, handles it and moves it pointer for the last handled event to 2.
The eventengine checks the eventq for any event with an id > 2. None are found.
Net result: event 1 stays in the queue until eventengine is restarted.
The best solution is likely for the eventengine to always load the entire eventq, and keep a map of known postponed events to avoid handling these twice. Any event entry not in this map will be handled.
summary: |
- Some events are ignored by eventengine + Race condition may make eventengine ignore events at random |
Changed in nav: | |
status: | Fix Committed → Fix Released |
fix committed here: https:/ /nav.uninett. no/hg/nav/ rev/03a1141566e a