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

Small issue with Atmosphere on Websphere Liberty when shutting down the server. #1974

Closed
seamusmac opened this issue May 7, 2015 · 9 comments

Comments

@seamusmac
Copy link
Contributor

I have recently upgraded to the latest Atmosphere version, 2.3.0.

I have been noticing this error, whenever I shutdown the server. Its not a big issue, but thought I would let you know, May be a very simple fix. The stacktrace is below:

[AUDIT   ] WTRN0105I: The transaction service has shutdown successfully with no transactions requiring recovery.
[AUDIT   ] CWWKE0036I: The server baseServer stopped after 55 minutes, 44.679 seconds.
Exception in thread "Thread-27" java.lang.RuntimeException: SESN0007E: There was an attempt to access a session while the application server was stopping. 
    at com.ibm.ws.session.store.memory.MemoryStore.throwException(MemoryStore.java:758)
    at com.ibm.ws.session.store.memory.MemoryStore.getSession(MemoryStore.java:242)
    at com.ibm.ws.session.store.memory.MemoryStore.getSession(MemoryStore.java:814)
    at com.ibm.ws.session.SessionManager.getSessionFromStore(SessionManager.java:466)
    at com.ibm.ws.session.SessionManager.getSession(SessionManager.java:444)
    at com.ibm.ws.session.SessionManager.getSession(SessionManager.java:431)
    at com.ibm.ws.session.SessionManager.getSession(SessionManager.java:678)
    at com.ibm.ws.webcontainer.session.impl.HttpSessionContextImpl.getIHttpSession(HttpSessionContextImpl.java:473)
    at com.ibm.ws.webcontainer.session.impl.HttpSessionContextImpl.getIHttpSession(HttpSessionContextImpl.java:637)
    at com.ibm.ws.webcontainer.srt.SRTRequestContext.getSession(SRTRequestContext.java:105)
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getSession(SRTServletRequest.java:2161)
    at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:238)
    at org.apache.shiro.web.servlet.ShiroHttpServletRequest.getSession(ShiroHttpServletRequest.java:143)
    at org.atmosphere.cpr.AtmosphereRequest.getSession(AtmosphereRequest.java:796)
    at org.atmosphere.cpr.SessionTimeoutSupport.restoreTimeout(SessionTimeoutSupport.java:69)
    at org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:822)
    at org.atmosphere.cpr.AtmosphereResourceImpl.close(AtmosphereResourceImpl.java:903)
    at org.atmosphere.cpr.AtmosphereFramework.closeAtmosphereResource(AtmosphereFramework.java:1757)
    at org.atmosphere.cpr.AtmosphereFramework.destroy(AtmosphereFramework.java:1770)
    at org.atmosphere.cpr.AtmosphereFramework$4.run(AtmosphereFramework.java:925)
jfarcand added a commit that referenced this issue May 7, 2015
@jfarcand jfarcand closed this as completed May 7, 2015
@seamusmac
Copy link
Contributor Author

I have been testing this with Atmosphere 2.4.0, and have found 2 small issues related to this. Do you want me to submit a PR that fixes it.

@jfarcand
Copy link
Member

@seamusmac +1

@seamusmac
Copy link
Contributor Author

Testing right now, also found another issue in the AtmosphereFramework class where the shutdown hook is made null before it is removed.

@seamusmac
Copy link
Contributor Author

I had to add the catch to endAsyncContext cos it was being called 2 times, due to the AtmosphereFramework.closeAtmosphereResource() method.

It calls: ar.resume().close();

  1. resume -- >> Servlet30CometSupport.action > Servlet30CometSupport.endAsyncContext
  2. close -- >> ar.cancel > Servlet30CometSupport.complete > Servlet30CometSupport.endAsyncContext

@seamusmac
Copy link
Contributor Author

@jfarcand what do you think, should complete be called 2 times on shutdown? Is the PR ok?

jfarcand added a commit that referenced this issue Nov 18, 2015
@jfarcand
Copy link
Member

@seamusmac No two times must be fixed. Is your pull fixing this? If not, pull request :-)

@seamusmac
Copy link
Contributor Author

@jfarcand 2 times is fixed now, also remove the last catch I added in previous PR as it is not needed now.

@jfarcand
Copy link
Member

@seamusmac Too late I've released 2.4.0.1 :-)

@seamusmac
Copy link
Contributor Author

@jfarcand thanks for that, I have updated to last version 2.4.0.1 and all works well 👍

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

No branches or pull requests

2 participants