On 09/02/2015 10:36, Bin Wu wrote: > During the mirror phase with nbd devices, if we send a cancel command or > physical network breaks down, the source qemu process will receive a readable > event and the main loop will invoke nbd_reply_ready to deal with it. This > function finds the connection is down and then goes into > nbd_teardown_connection. nbd_teardown_connection wakes up all working > coroutines > by nbd_recv_coroutines_enter_all. These coroutines include the one which holds > the sending lock, the ones which wait for the lock, and the ones which wait > for > receiving messages. > > I think the purpose of nbd_recv_coroutines_enter_all is to terminate all > waiting > coroutines by waking all of them up. If the coroutine waiting for the lock is > allowed for waking up, this implementation is ok. If not, we need to > distinguish > the coroutines waiting for receiving messages from the ones waiting for the > lock. > > In my option, if the coroutines waiting for a lock is allowd for waking up, it > should be more robust :>
No, it's not allowed. Paolo