Re: simultaneous close
"William J. Mills" <[email protected]> Fri, 13 Feb 2004 14:10:06 -0800
| Newsgroups | gmane.network.beep.beepcore.c.general |
|---|---|
| Message-ID | <[email protected]> |
Memory tells me we recognized that deadlock, and I thought we resolved it. As I remember the right thing is for one end to refuse the close and the other accepts it. We did something arbitrary like initiator should go ahead and close. I guess that's not working. The core dump is coming from the socket close event I think. So it's really 2 bugs. Went and looked at the code. Fix will be non-trivial. Problem is that the way the code is I have it blocking n a wait loop. Unfortunately I think this is blocking the thread that needs to process the close from the other end. There is no quick fix I think. Major fault. The wait is in waitfor_chan_stat_quiescent() and that is called from blw_close_request_non0(). I am not sure if we can put something in the waitfor function to process further events in chan 0 because I am not sure what the semaphore states are. Theoretically the waitfor functions allow the right things to happen in other threads. Might be able to solve this by dispatching the events differently. Not sure. -bill On Fri, Feb 13, 2004 at 01:32:23PM -0800, Lei Zhang wrote: > Yep. Looks like both sides wait for the channel status to be QUIESCENT, > but both sides are in the HALFCLOSE state. > > William J. Mills wrote: > > >Hmmmm... well that's a bad bug. > > > >Simultaneous from both ends in same channel? > > > >-bill > > > > > >On Fri, Feb 13, 2004 at 11:40:31AM -0800, Lei Zhang wrote: > > > >>Knowing that beepcore-c is dead, still it's worthwhile reporting this: > >> > >>beepcore-c is not able to handle simultaneous channel close. I see the > >>following call sequences: > >> > >> listener initiator > >> > >> close_indication local close_indication local > >> close_indication remote close_indication remote > >> > >>Neither side gets to the close_confirmation stage. After waiting a > >>while, kill one peer, the other peer core dumps saying 'assertion > >>"wrap->iostate != 0" failed' in bp_notify.c. > >> > >>well, well... > >> > > ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click