directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Commented: (DIRSEDA-6) Race condition between disconnect and output events
Date Thu, 16 Sep 2004 08:38:38 GMT
The following comment has been added to this issue:

     Author: Trustin Lee
    Created: Thu, 16 Sep 2004 1:37 AM
If it is guarenteed that all Subscribers knows the list of managed channels, we will be able
to resolve the first case.  Subscribing and unsubscribing rarely happens, so it should be
okay.  The performance problem exists when the connections are very ofen established and closed

Using a priority queue will be helpful here.  This solution brings up another synchronization
issue that can slow down overall performance per channel although the synchronization block
(getting nextval) is small enough.  Plus a customized high-performance priority queue implementation
is required.  Each event types will have their own priorities and the sequence of an event
will be of the second priority which can be disabled by user.  This solution will solve issue
DIRSEDA-5, too.

The second case is more complicated.  In worst case, we can receive output event one or two
seconds later disconnection event is arrived.  There is no easy solution because EventRouter
cannot predict there will be more output events which is scheduled.  Notifying the user that
the event was not processed due to unexpected disconnection would be the best we can do; the
user will choose whether to retry it later or just to drop it.
View this comment:

View the issue:

Here is an overview of the issue:
        Key: DIRSEDA-6
    Summary: Race condition between disconnect and output events
       Type: Bug

     Status: Open
   Priority: Major

    Project: Seda Framework

   Assignee: Alex Karasulu
   Reporter: Alex Karasulu

    Created: Thu, 16 Sep 2004 12:23 AM
    Updated: Thu, 16 Sep 2004 1:37 AM

On occasion I get the following failure from the echo server test:

-- o error message o --

Sep 16, 2004 2:50:52 AM org.apache.seda.output.LoggingOutputMonitor channelMissing WARNING:
org.apache.seda.output.DefaultOutputManager@2d9c06 could not find channel for client<-

-- o error message o --

Now this means a channel for the client was expected in the output manager but was not found.
 This can be caused by two possible conditions:

 1). the channel was not put into the output manager before first output event was processed
 2). the channel was removed from the output manager before all the output events could be

In the first case we have a race condition between the thread processing a ConnectEvent and
a thread processing an OutputEvent.  The ConnectEvent processing is really slow in this case
because all the stages were traversed via input->decode->reqproc->output before the
ConnectEvent was handled.  That's a little far fetched so I'm going to presume that the second
case is more likely.

In the second case the race condition is between the thread processing a DisconnectEvent and
a thread processing an OutputEvent.  The DisconnectEvent in this case is outrunning the processing
of the OutputEvent.  Before the OutputEvent can flush out data to the client the channel to
the client is removed from the output manager by the DisconnectEvent.

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message