DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42753>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42753

           Summary: Race condition when using available() or reading in
                    CometProcessor.event()
           Product: Tomcat 6
           Version: unspecified
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Tomcat version: 6.0.13 (no 6.0.13 available in the version field)

When trying to process data in CometProcessor.event() either during the BEGIN
event or during the READ event, it is impossible to guarantee that all data has
been read before returning (since new data may arrive between the last statement
before the return, and the return statement itself). However, the
CoyoteProcessor does this check:

 } else if (!error && read && request.getAvailable()) {
    // If this was a read and not all bytes have been read, or if no data
    // was read from the connector, then it is an error
    error = true;
    log.error(sm.getString("coyoteAdapter.read"));
 } 

causing a severe error and the Comet request to break when this race condition
manifests itself.

I am using the following code according to the aio.html description to read data
in my comet event handler:

  while (request.getInputStream().available() > 0) {
     // read some data
  }
  // ***** NO MORE DATA AVAILABLE
  return;

And I am experiencing the error as described in certain conditions (rapid
arrival of fragmented data):

SEVERE: The servlet did not read all available bytes during the processing of
the read event

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to