[systemd-devel] [PATCH v2 00/26] Initial DHCP v4 library implementation
Lennart Poettering
lennart at poettering.net
Mon Nov 25 14:52:49 PST 2013
On Mon, 25.11.13 09:13, Patrik Flykt (patrik.flykt at linux.intel.com) wrote:
> After that I noticed someting interesting when setting a monotonic timer
> event to go off at time 0. It seems to repeatedly call the timer event
> without stopping, either due to the next timer computation going wrong in
> my code or then the reshuffling of the event queue in sd-event. As I
> couldn't figure out the root cause, I left the timer setting to
> now(CLOCK_MONOTONIC) instead of the proposed value 0.
Hmm, are you aware of SD_EVENT_SOURCE_ON vs. SD_EVENT_SOURCE_ONESHOT?
The former leaves the event source on forever, and that means a timer is
dispatched over and over and over again (immediately, since the rule is
to execute a timer as soon as the configured time is passed, and that it
will be continously after it elapsed once), until it is explicitly
disabled. The latter is turned off automatically when it is first
dispatched. Of course, timer callbacks should only be called once, ence
ONESHOT mode is the default -- unless you change that explicitly.
If this doesn't solve the issue, I wouldn't be surprised if there was
still a bug lurking with the sd-event code. Note that I fixed a bug like
this last week, did you check with currentl git of sd-event if the issue
persists?
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list