wasync
wasync copied to clipboard
Race condition in Socket.open
I am using wasync to connect using websocket to an Atmosphere server that, while developing, is on the same machine. I kept getting timeouts when trying to open the wasync socket, but my logging indicated that a request was being made to the Atmosphere handler, and when I added a breakpoint into the handler to try and diagnose the problem, it stopped happening.
Eventually I discovered that adding a Thread.sleep delay in the Atmosphere handler's processing of the GET request fixed the problem. It seems that wasync has a race condition in its connection code that means it cannot handle situations where the server responds very quickly to the initial request.
Which server are you using for testing it? There is a problem with Netty
Also can you link to a Test case? Or try one of the unit test to see if you can reproduce. Thanks!
I am using Netty, I guess? I am just using wasync and its default dependencies acquired from Maven Central. I am trying to get a reduced test case, but it's proving a little difficult to disentangle from our application code.