BIND 10 #335: b10-xfrout not exiting
BIND 10 Development
do-not-reply at isc.org
Sat Oct 9 04:11:54 UTC 2010
#335: b10-xfrout not exiting
-------------------------+--------------------------------------------------
Reporter: jreed | Owner: zhanglikun
Type: defect | Status: reviewing
Priority: major | Milestone:
Component: xfrout | Resolution:
Keywords: | Sensitive: 0
Estimatedhours: 0.0 | Hours: 0
Billable: 1 | Totalhours: 0
Internal: 0 |
-------------------------+--------------------------------------------------
Comment(by zzchen_pku):
Replying to [comment:7 vorner]:
> It calls shutdown in one thread and checks that other thread already
exited. But it does not have enough time to do so, the is_alive() is
called too early (there's a race condition, running again produced only
one failed test, not 2). You do wait for the thread event, but then,
there's still the thread teardown (like exit from the function and such)
and if a context switch happens on the event set (set is called, the
thread which called shutdown is woken up and the one that was shutting
down do not have time to exit the function).
Good catch. Main thread will sleep for a while to ensure that the timer
thread has enough time to exit.
> Not that we ignore all exceptions without doing something with them,
this also catches all kinds of KeyboardInterrupt or SystemExit objects
that are not proper exceptions. We should at last catch Exception, but,
best of, catch only the one that killed msgq generates (and probably log a
warning).
Likun will handle it.
> I think there shouldn't be None, but the exception that really is
thrown, because the code can fail for some other reason and we shouldn't
catch that.
Okay.
> {{{
> if self._read_sock in rlist: # awaken by shutdown socket
> break
> }}}
>
> As linux man page says in the Bugs section: „Under Linux, select() may
report a socket file descriptor as "ready for reading", while nevertheless
a subsequent read blocks.“ If such spurious wakeup happens on the
_read_sock, we should not exit. Note that continue instead of break would
solve this, since self._runnable would be False if the real shutdown
comes.
I am not sure what will trigger that affect, but it works for me, I update
the code according to your suggestions.
Thank you for your comments.
--
Ticket URL: <http://bind10.isc.org/ticket/335#comment:9>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list