atmosphere-extensions
atmosphere-extensions copied to clipboard
Socket IO Module - Hanging on Shutdown
Environment: Atmosphere-Runtime 2.3.5 Atmosphere-Socket 2.3.2
running in a webapp on Tomcat 7.55
Issue: On shutdown of Tomcat...Tomcat hangs and never terminates
Cause: (As far as the issue has been traced)
SocketIOSessionManagerImpl used an executor that doesn't get property shutdown. So the heartbeat is preventing shutdown.
Suggested Fix:
Shutdown the executor when the AtmosphereFramework destroys the interceptor.
@dshurt Pull request welcomed!
Alright, I'll see what I can do.
Could you tell me more about your case? Recently I'm looking for a way to integrate the socket.io and tomcat .But I'm facing this problem here when i start up tomcat :
javax.servlet.ServletException: Not running on Jetty, JSR-356 support unavailable
I'm not sure what did that mean.At first I think it looks like Atmosphere-extensions for SocketIO cann't running in tomcat,but now it seems like you did it.So I'm looking for some help here,THx
Sounds like that exception is about websocket support. Tomcat 7+ should have websocket support. However, some older version may have a custom version. (check your tomcat lib dir for websocket-api.jar, and tomcat7-websocket.jar or equivalent) I didn't have issue with websocket with tomcat but I did have issue with long poll (comet) support. My issue, I believed, stems from a library call Stripes framework which has some filters that don't support async calls.
This issue however was all about the shutdown of tomcat. The socket io extension opens a thread pool which wasn't shutdown properly. I created a pull request to correct that. I'm currently using this solution. I used the socket io library (0.98 version) on the client for websocket and atmosphere on the server. Keep mind, if your server sits behind a proxy (Eg. Apache, nginx...etc) they must be setup to support websocket or it won't work. In my case, I detect that and fall back to client-side polling since long poll didn't work.
Hopefully that's helpful.
@dshurt Where is your pull request? Do it again and I will merge and release.
It was merged several months ago. However, I don't know if was released.
See https://github.com/Atmosphere/atmosphere-extensions/pull/212
Hi, I was looking into the code and only 'extensions-2.3.x' branch includes these changes but 'extensions-2.4.x' and 'master' don't.
Just check out destroy() method of org.atmosphere.socketio.cpr.SocketIOAtmosphereInterceptor on these branches.
Is that ok?
@jcstarna Pull request welcomed :-)