You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by ji...@apache.org on 2004/09/16 09:23:37 UTC

[jira] Created: (DIRSEDA-6) Race condition between disconnect and output events

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/DIRSEDA-6

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 12:23 AM

Description:
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 127.0.0.1:7<-127.0.0.1:2402

-- 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 processed

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.



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRSEDA-6) Race condition between disconnect and output events

Posted by ji...@apache.org.
The following comment has been added to this issue:

     Author: Alex Karasulu
    Created: Thu, 16 Sep 2004 12:26 AM
       Body:
Generally we must make sure that certain events do not process for a client until other events have completed.  This can be managed through a client session object which contains the events being processed for the client.  Components can synchronize waiting for these events to complete.  We need to think about this some more.
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/DIRSEDA-6?page=comments#action_53127

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/DIRSEDA-6

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 12:26 AM

Description:
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 127.0.0.1:7<-127.0.0.1:2402

-- 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 processed

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.



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DIRSEDA-6) Race condition between disconnect and output events

Posted by ji...@apache.org.
Message:

   The following issue has been re-assigned.

   Assignee: Trustin Lee (mailto:trustin@gmail.com)
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/DIRSEDA-6

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: Trustin Lee
   Reporter: Alex Karasulu

    Created: Thu, 16 Sep 2004 12:23 AM
    Updated: Sat, 23 Oct 2004 12:52 PM

Description:
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 127.0.0.1:7<-127.0.0.1:2402

-- 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 processed

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.



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DIRSEDA-6) Race condition between disconnect and output events

Posted by ji...@apache.org.
The following comment has been added to this issue:

     Author: Trustin Lee
    Created: Thu, 16 Sep 2004 1:37 AM
       Body:
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 soon.

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:
  http://issues.apache.org/jira/browse/DIRSEDA-6?page=comments#action_53128

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/DIRSEDA-6

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

Description:
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 127.0.0.1:7<-127.0.0.1:2402

-- 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 processed

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.



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira