Race condition may make eventengine ignore events at random

Bug #1593193 reported by Morten Brekkevold
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
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.

Tags: eventengine
summary: - Some events are ignored by eventengine
+ Race condition may make eventengine ignore events at random
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: Confirmed → Fix Committed
milestone: none → 4.5.1
Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.