Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket IO Module - Hanging on Shutdown #211

Open
dshurt opened this issue Oct 23, 2015 · 8 comments
Open

Socket IO Module - Hanging on Shutdown #211

dshurt opened this issue Oct 23, 2015 · 8 comments

Comments

@dshurt
Copy link

dshurt commented Oct 23, 2015

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.

@jfarcand
Copy link
Member

@dshurt Pull request welcomed!

@dshurt
Copy link
Author

dshurt commented Oct 23, 2015

Alright, I'll see what I can do.

dshurt added a commit to dshurt/atmosphere-extensions that referenced this issue Oct 26, 2015
Fix for not releasing resources causing hang
jfarcand added a commit that referenced this issue Oct 26, 2015
#211 - Socket IO Module - Hanging on Shutdown
@2efPer
Copy link

2efPer commented Apr 15, 2016

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

@dshurt
Copy link
Author

dshurt commented Apr 16, 2016

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.

@jfarcand
Copy link
Member

@dshurt Where is your pull request? Do it again and I will merge and release.

@dshurt
Copy link
Author

dshurt commented Apr 19, 2016

It was merged several months ago. However, I don't know if was released.
See #212

@jcstarna
Copy link

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?

@jfarcand
Copy link
Member

jfarcand commented Apr 2, 2017

@jcstarna Pull request welcomed :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants