On 2/28/2012 11:39 AM, Mark Thomas wrote:
Thanks for the feedback.

You may also be able to help with some problems I am having getting
non-blocking behaviour between messages with NIO. I'm not 100% clear
what is happening yet, but I think it is something like:
- HTTP GET (with upgrade request arrives
- Upgrade is processed
- no ws frame on the wire (yet) so process of handing back to the
selector starts
- first ws frame arrives
- socket is handed back to the selector
- selector*does not*  trigger indicating there is data to process
- some delay of a few seconds
- client sends another ws frame
- selector triggers
- both frames are processed

I can force this behaviour 100% of the time with the debugger and it
looks very similar to the issues we see intermittently with the Comet
unit tests where two messages are processed at once.

I am wondering if we have a race condition somewhere in the NIO code
between:
- determining there is no data to read
- handling the socket back to the selector
- new data arriving
and if it is possible that for a particular sequence of events we can
end up in the state where there is data to be read but the selector
doesn't think so.

I would normally assume my non-blocking code is doing something stupid
(which it may well be anyway) but the similarity to the problem with the
Comet unit test makes me suspect at least one root cause may be elsewhere.

Any thoughts appreciated.

(Note all of my non-blocking changes are currently sitting on my local
hard drive. I can provide them if that would help.)

Mark
Alright, now that I'm all squared away with Autobahn and test cases running. Is 
there a specific unit test you have to produce this behavior?
That would help me for digging through it.
Filip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to