-
1. Re: WebSocket connection closes after 65 seconds no matter what
davidj Oct 2, 2014 7:56 PM (in response to davidj)I've been researching this all day without success, but I did come across something that might be a clue.
65 seconds is a strange timeout value. I think the real timeout is probably 60 seconds and it just takes an extra 5 seconds for the Thread to stop. So I debugged and examined the Web-socket Session object and found a value of 6000000000 for the "keepAliveTime" (under the executorService for remoteEndpointAsync/Basic). See screenshot below:
I tried changing that value in the debugger but it didn't make a difference, but that gave me the idea to search source-code in Tomcat/JBoss and found this:
public static final String EXECUTOR_KEEPALIVETIME_SECONDS_INIT_PARAM = "org.apache.tomcat.websocket.executorKeepAliveTimeSeconds";
...
long executorKeepAliveTimeSeconds = 60;
...
value = servletContext.getInitParameter(
Constants.EXECUTOR_KEEPALIVETIME_SECONDS_INIT_PARAM);
if (value != null) {
executorKeepAliveTimeSeconds = Long.parseLong(value);
}
This code taken from: [jbossweb-commits] JBossWeb SVN: r2299 - in branches/7.4.x/src/main/java/org: jboss/web and 1 other directory.
So perhaps JBoss isn't supplying a param called "org.apache.tomcat.websocket.executorKeepAliveTimeSeconds" and so a default of 60 seconds is used?
Am I barking up the wrong tree? Surely I can't be the only person who has tried keeping a Websocket open on JBoss EAP 6.3 for longer than 60 seconds?
I want to figure-out how to set the "org.apache.tomcat.websocket.executorKeepAliveTimeSeconds" value, but I don't know how. Plus, what value would I set it to? (-1, 0, 99999999999999999)?
Does anyone have any ideas?
Thanks.
-
2. Re: WebSocket connection closes after 65 seconds no matter what
ammt Oct 22, 2014 4:45 AM (in response to davidj)Hi David,
I have the same problem, and I resolved it sending a ping message (session.getBasicRemote().sendPing(buffer)) every 60 seconds.
I know it's not very efficient, but it is the only thing that worked for me
-
3. Re: WebSocket connection closes after 65 seconds no matter what
davidj Oct 22, 2014 10:29 AM (in response to ammt)Hi Andrea,
It is useful to learn that someone else is having the same problem; at least now we know individual configuration isn't the problem. Thanks.
The corporation I work for has finally purchased a Support Agreement with Red Hat, so I am able to create a support ticket with Red Hat which hopeful will require the engineers to investigate this issue (since obviously they aren't looking at it now).
- David
-
4. Re: WebSocket connection closes after 65 seconds no matter what
jaikiran Oct 22, 2014 10:33 AM (in response to davidj)Moved to the right forum which WildFly/EAP developers watch.
-
5. Re: WebSocket connection closes after 65 seconds no matter what
davidj Nov 10, 2014 6:03 PM (in response to jaikiran)My employer received a response from Red Hat; the news isn't good. I was correct earlier in this thread where I talked about the "keepAliveTimeout" being set to 60 seconds. Therefore, a websocket connection is closed in 60 seconds. Red Hat also informed us that "websocket is tech preview which mean we don't suggest customer use this feature in production environment". This is unfortunate because I'll need to re-design my current task. "Tech Preview" is a double-edged sword, on one hand it is nice to get earlier access to exciting new functionality, but on the other hand, if the new functionality doesn't work there's nothing gained.
Hopefully JBoss EAP 6.3.1 will soon be released with a fix.
-
6. Re: WebSocket connection closes after 65 seconds no matter what
ctomc Nov 12, 2014 12:08 PM (in response to davidj)1 of 1 people found this helpfulDavid Jensen wrote:
Hopefully JBoss EAP 6.3.1 will soon be released with a fix.
6.3.2 was already released... you can grab patches to upgrade 6.3.0 to it in customer portal.
-
7. Re: WebSocket connection closes after 65 seconds no matter what
davidj Nov 12, 2014 12:21 PM (in response to ctomc)Thanks Tomaz. I appreciate the heads-up. I usually only check the public site, and 6.3.2 isn't yet available. I just logged-in thru the customer portal and verified it is available there.
Do you know if this issue is fixed in the update?
Thanks
-
8. Re: WebSocket connection closes after 65 seconds no matter what
davidj Nov 19, 2014 10:31 AM (in response to davidj)I have obtained JBoss EAP 6.3.2 (as a patch), but unfortunately the problem still exists.