init: respawn detection relies on non-monotonic clock
Bug #389586 reported by
Scott James Remnant (Canonical)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Fix Released
|
High
|
Scott James Remnant (Canonical) |
Bug Description
The respawn detection works by recording the last time that the job was respawned, and then when it is next due to be respawned, seeing if the delta between the two is greater than the respawn interval. The time it uses is obtained from time(NULL), the UNIX seconds since epoch.
This is not safe against changes to the system clock; any change to the system time would be incorrectly either result in jobs being flagged as respawning too fast, or jobs NOT being flagged when they are.
clock_gettime (CLOCK_MONOTONIC) should be used instead, or the code re-engineered completely
Changed in upstart: | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in upstart: | |
status: | Triaged → Fix Committed |
Changed in upstart: | |
milestone: | none → 0.6.0 |
To post a comment you must log in.
Any idea when can this be fixed?