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

Websocket @OnOpen sometimes isn't called #536

Closed
kekkokk opened this issue Nov 26, 2015 · 5 comments
Closed

Websocket @OnOpen sometimes isn't called #536

kekkokk opened this issue Nov 26, 2015 · 5 comments

Comments

@kekkokk
Copy link

kekkokk commented Nov 26, 2015

Hi there,
I deployed my project into payara 4.1.1.115 and 4.1.1.116 (coming from glassfish 4.1 open source ed) and everything works fine except for an issue: the chat, sometimes won't work.
It appears that the client can ALWAYS connect and do the handshake with the server but sometimes the @onopen won't be called.
Thinking to a bad implementation I created a new project from scratch, consisting in two components:
client: index.htm
serverside: websocket.java

it is the simplest implementation of a websocket I could made, copying the example at https://blog.idrsolutions.com/2013/12/websockets-an-introduction/

The problem persist:
if you open and close the websocket connection, at the 4th time it will "crash". it's able to do the handshake but the @onopen method won't be called and you won't be able to exchange data in that channel.
from this time, if you continue opening and closing the connection, it will works randomly.

I tried to upgrade / downgrade java, tried to upgrade to the new tyrus 1.12 and downgrade to 1.8.1 (the same as glassfish 4.1, which actually works flawlessly) and also tried to downgrade to the gf4.1 grizzly version. none of this thing solved the problem.

I was also able to reproduce this behaviour in glassfish 4.1.1 open source edition.
Tried also with different computers with different os and different jdk version but the results are the same.

I think this is a major issue but my competences stops here.

Wasn't able to reproduce the issue in 4.1.153

@lennartkoester
Copy link

I can reproduce with
Payara Server 4.1.1.154
Grizzly Framework 2.3.23
Tyrus 1.11.0

The 4th time always fails.

The Configurator is still called and the modifyHandshake() runs through - but the following @onopen is never called.

Edit:
Using tyrus-server.jar 1.8.1 seems to 'fix' this

@HighTower1991
Copy link

I can reproduce with Payara Server 4.1.1.154, but on Glassfish 4.1.1 it's works. Sample project:
HighTower1991/PayaraTest@7dc752e

@smillidge
Copy link
Contributor

Thanks we will take a look.

@mikecroft
Copy link
Contributor

Easily reproduced with the example from @HighTower1991. I find that it seems to be very random which ones succeed and which fail, but it seems to be a minimum of 1 in 4 times.

@smillidge
Copy link
Contributor

@HighTower1991 Thanks for the great test case this made it very simple to track down the problem and fix it.

smillidge added a commit that referenced this issue Dec 24, 2015
@smillidge smillidge added this to the Payara Server 4.1.161 milestone Jan 24, 2016
Pandrex247 pushed a commit to Pandrex247/Payara that referenced this issue Jan 28, 2022
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

5 participants