deepstreamIO / deepstream.io-client-java

The Java/Android Client for deepstream.io
Other
35 stars 37 forks source link

Server that uses deepstream client has CPU 100% when deepstream server stopped #104

Open jamesalexscott opened 6 years ago

jamesalexscott commented 6 years ago

I'm running a Jersey/Spring based API on Tomcat 8 that uses the deepstream Java client to connect to deepstream and then send various RPC requests. I've been developing and testing on Windows and everything has been fine.

Now I'm moving it into production on AWS (latest Linux on a t2.small). If I stop the deepstream server, the CPU immediately goes to 100% for the Tomcat process. When I restart deepstream and the API logs back in to deepstream but the CPU still remains at 100%. Only a Tomcat restart fixes it.

I'm also using the client in Android and it has the same issue. Though CPU goes from 5% to 60%

honorcode commented 6 years ago

We just saw the same issue on our java clients when restarting aws ds servers. Even with 'wrapped' re-connection logic (full client.close(), client=null, client=new DeepstreamClient, client.login) - no recovery, our service nodes need full restarts.

jamesalexscott commented 6 years ago

It wasn't the change from Windows to Linux. It was the change from ws to wss. Seems there may be an infinite loop issue with the underlying Java-Websocket.

Doesn't look like it will be fixed until 1.3.5

https://github.com/TooTallNate/Java-WebSocket/issues/424

WolframHempel commented 6 years ago

Thanks for raising, we'll need to get a release date for java websocket 1.3.5 asap. A temporary workaround for backend services could be switching back to ws and using e.g. https://www.stunnel.org/index.html for encryption On 29 Aug 2017 03:21, "jamesalexscott" notifications@github.com wrote:

It wasn't the change from Windows to Linux. It was the change from ws to wss. Seems there may be an infinite loop issue with the underlying Java-Websocket.

Doesn't look like it will be fixed until 1.3.5

TooTallNate/Java-WebSocket#424 https://github.com/TooTallNate/Java-WebSocket/issues/424

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/deepstreamIO/deepstream.io-client-java/issues/104#issuecomment-325526972, or mute the thread https://github.com/notifications/unsubscribe-auth/ABbx5QqmFBa5A2iCXpwxNplwZXl2G7h0ks5sc2epgaJpZM4PEIra .