BIND 10 #335: b10-xfrout not exiting
BIND 10 Development
do-not-reply at isc.org
Sun Oct 10 14:56:35 UTC 2010
#335: b10-xfrout not exiting
-------------------------+--------------------------------------------------
Reporter: jreed | Owner: vorner
Type: defect | Status: reviewing
Priority: major | Milestone:
Component: xfrout | Resolution:
Keywords: | Sensitive: 0
Estimatedhours: 0.0 | Hours: 0
Billable: 1 | Totalhours: 0
Internal: 0 |
-------------------------+--------------------------------------------------
Changes (by zzchen_pku):
* owner: zhanglikun => vorner
Comment:
Replying to [comment:12 vorner]:
> The spurious wakeup does not happen usually, as I gather it happens only
under extreme conditions (high load, bad checksum on incoming packet) and
it is considered a bug. But as it should not break on working system, it
is OK to provide a workaround I think. Thanks for including it.
Got it, thanks.
> About the race condition, the sleep(1) does help sometime, but not
always, I was still able to reproduce it. And I found another one. If
run_timers is run in one thread and shutdown soon after, the shutdown
calls _is_runnable = False first and then the other thread sets
_is_runnable = True. May I suggest using a wrapper to run the run_timers
in another thread, that would store the thread object and calling .join on
it instead of having the event object? It seems cleaner and would remove
both problems, because the _is_runnable could be called before the thread
is started.
Actually, Zonemgr calls _start_zone_refresh_timer() to run run_timers and
.join on shutdown, you can find them in Zonemgr class.
I have updated the test case to call .join on timer thread shutdown. This
blocks the main thread until the timer is terminated.
> And I noticed one more thing. We shouldn't call run_timers, then
shutdown and then run_timers again, because the shutdown pipe would still
contain b'shutdown' and would still be readable ‒ and we would get a busy
loop. Maybe it should be mentioned in documentation that one should not
call run_timers multiple times on the same object. Or, clean the pipe (or
create a new one and throw the old one away) on each run_timers start.
Zonemgr process only call run_timers once on startup, but since unittest
may call it more than once, clean the pipe on each run_timers shutdown to
handle the busy loop.
diff : svn diff -r 3152
--
Ticket URL: <http://bind10.isc.org/ticket/335#comment:13>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list