Issue Details (XML | Word | Printable)

Key: GLASSFISH-18676
Type: Bug Bug
Status: Closed Closed
Resolution: Incomplete
Priority: Major Major
Assignee: oleksiys
Reporter: vasim
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
glassfish

Http Session gets invalidated

Created: 02/May/12 11:52 AM   Updated: 08/Apr/13 10:41 PM   Resolved: 08/Apr/13 10:41 PM
Component/s: grizzly-kernel
Affects Version/s: 3.1.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Java Archive File web-core.jar (1.09 MB) 02/May/12 10:02 PM - Ryan Lubke

Image Attachments:

1. invalid_session_unsubscribe.jpg
(123 kB)
Environment:

glassfish 3.1.2 Release, Windows 7, FF or IE.


Tags:
Participants: oleksiys, Ryan Lubke and vasim


 Description  « Hide

We have an issue in a Atmosphere application using streaming or long-polling.
After the js code is subscribing for a request then the server-side code is doing a request.suspend() and then a broadcasting.
In the time of broadcasting the suspend call seems is not completed and then the glassfish thrown error 503 and this error invalidates the htt session of the client.
Very hard for me to provide a sample.
I advice tzo use the atmosphere-pubsub sample project.
The idea is if you don't have authentication in the project like in the atmosphere-pubsub you cannot see the error.
In this sample project if authentication will be added then should be reproducable. Eventually adding broadcasting directly after suspend will allow to reproduce the rror easy.
See the thread when I discussed this error with Jeanfrancois::
http://groups.google.com/group/atmosphere-framework/browse_thread/thread/cdf1090797bc727e#

Unfortunately my app I cannot deliver because of the complexity(app using a db connection) and license reasons.



Ryan Lubke added a comment - 02/May/12 10:02 PM

Vasile,

Could you please back up your $GF_HOME/modules/web-core.jar and replace it with the web-core.jar I've attached to this issue? This should show us where the session is being invalidated from.

Thanks,
-rl


Ryan Lubke added a comment - 07/May/12 06:07 PM

Hi Vasile,

Any update?


vasim added a comment - 09/May/12 04:01 PM - edited

Sorry for answering so late.
I was very busy.
The idea is I found a work around in the app to avoid this error.

Actually are 2 errors:
1. suspend and broadcasting one after another is generating the session invalidation. Here was helping a thread sleep after suspend.
The problem occured only if I used for brodcasting same request as for suspend.

2. throwing the error 503 in the web app is generating the session invalidation. The error 503 was thrown by Atmosphere and now we took it out. Actually in my opinion glassfish is here wrong implemented, why in this error case the session should be invalidated ? In the case the application is doing another request after such an error, then the seesion will be of course used and the app is not allowed to do anything any more. This means the app needs a new login and I don't find this normal.

You need some log files from me, in adition to this new informations ?


oleksiys added a comment - 30/May/12 11:50 AM

Hi Vasile,

yes, pls. send GF server.log file, when session invalidation happens again.

Regarding point 1) you mentioned a thread.sleep... it might be a bug by design, cause in Grizzly Comet (Jeanfrancois has to know about that ) ) the actual "suspend" initialization happens after you exit Servlet.service(...) method. So if this initialization clashes w/ broadcaster thread - it may cause problems. IMO possible fix will include changes on both Grizzly and Atmosphere sides.

thx.

Alexey.


oleksiys added a comment - 12/Jun/12 03:38 PM

hi,

changing the priority to major.
will appreciate if you can apply the patch and once the issue occurs provide resulting GF server.log file.

Thx.