wasync icon indicating copy to clipboard operation
wasync copied to clipboard

Race condition in Socket.open

Open jonrimmer opened this issue 10 years ago • 3 comments

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.

jonrimmer avatar Mar 24 '14 22:03 jonrimmer

Which server are you using for testing it? There is a problem with Netty

jfarcand avatar Mar 25 '14 12:03 jfarcand

Also can you link to a Test case? Or try one of the unit test to see if you can reproduce. Thanks!

jfarcand avatar Mar 25 '14 12:03 jfarcand

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.

jonrimmer avatar Apr 02 '14 15:04 jonrimmer