[Bug 57795] New: mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 57795] New: mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

            Bug ID: 57795
           Summary: mod_proxy_wstunnel sometimes does not connect and
                    sometimes does not disconnect
           Product: Apache httpd-2
           Version: 2.4.9
          Hardware: Macintosh
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_proxy_wstunnel
          Assignee: [hidden email]
          Reporter: [hidden email]

We use mod_proxy_wstunnel on port 80 because we want all traffic over the same
port. Http as well as the websocket.

In this configuration once connected everything works ok. But sometimes the
websocket does not connect and most of the time the websocket does not
disconnect. For example on browser refresh, the server does not notice the
disconnection and the server needs to ping to know the client is no longer
connected.

This seems to be a mod_proxy_wstunnel issue because websockets always connect
to- and disconnect from the application-server port. The difference between a
working configuration and a not working configuration is that there is
mod_proxy_wstunnel in between.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

bob <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from bob <[hidden email]> ---
I am sorry but i am not able to reproduce the problem.
I tried it with 2 different servers and 3 different browsers.
Please disregard bugreport. If it happens again i'll file a new one, hopefully
with additional information.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

Christophe JAILLET <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

Gaël Oberson <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---
           Priority|P2                          |P1
           Severity|normal                      |major

--- Comment #2 from Gaël Oberson <[hidden email]> ---
Using Chrome or Safari on IOS, open a Websocket to Tomcat8 over Apache wstunnel
(http connector). We use SockJS in an AngularJS WebApp, on iPad.

If you normally close the browser's tab or if you kill (swipe up) the App, then
the Javascript App will apparently not fire a websocket close(). In that case,
the socket remains open forever between Apache and Tomcat. Apache does not
'see' that the client went away.

Other browsers (on desktop OS's) are sending the close, but IOS (and perhap's
Android??) not.

In such a situation, the subsequent websockets handshakes are routed to this
"half closed" socket, and we run into error and a not working XHR fallback. It
just completely blocks the service.

Running the same use case without Apache and working directly with Tomcat runs
fine. Tomcat itself is capable to react to a 'disapeared' client and does close
the websocket.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #3 from Yann Ylavic <[hidden email]> ---
Which version of Apache HTTP Server are you using?

This (maybe relative) fix was done in 2.4.10:
  *) mod_proxy_wstunnel: Don't pool backend websockets connections,
     because we need to handshake every time. bug 55890.
There are also more fixes up to latest 2.4.12.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

Yann Ylavic <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #4 from Gaël Oberson <[hidden email]> ---
I just checked and we use Apache 2.4.7 on Ubuntu 14.04.1 LTS. The description
telling "don't pool connections" is the same as our thoughts. We came to the
conclusion that the connection is pooled and therefore subsequent handshakes on
this connection are logically not working.

But you also need to handle a client going away. I mean, not pooling is a good
point, but you also need to send a close() to tomcat in case the client goes
away without closing the WebSocket.

I think the simple use of disablereuse=on for the ProxyPass directive is not
enough.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #5 from Yann Ylavic <[hidden email]> ---
Latest versions do close both client and backend connections when done (on any
side).

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #6 from Yann Ylavic <[hidden email]> ---
(In reply to Gaël Oberson from comment #4)
>
> But you also need to handle a client going away. I mean, not pooling is a
> good point, but you also need to send a close() to tomcat in case the client
> goes away without closing the WebSocket.

Wait, the client is gone away when it closes its connection, mod_proxy_wstunnel
has no knowledge of the application (close) semantic.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #7 from Gaël Oberson <[hidden email]> ---
It's exactly what I point out. An IOS Chrome or Safari may be killed (just
swipe up) by the user. In that case, je JavaScript thread is instantly
terminated, and thus the SockJS client has no chance to close() the socket.

Therefore, Apache needs to handle this and become the ability to "be aware"
that the client just went away.

If you run this scenario without Apache, and directly use Tomcat, you will see
that Tomcat has this ability. When the IOS Browser is killed, Tomcat closes the
Socket immediately and releases the resources.

Thus, it should be possible for mod_proxy_wstunnel to do the same. Otherwise,
this will lead to a ressource leak.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

Gaël Oberson <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #8 from Yann Ylavic <[hidden email]> ---
I don't known much about IOS' browsers but it seems to me that if a socket has
no owner it should be closed...
And if the application is being killed, it can't even signal the application by
any mean, so how Tomcat knows?

Thus I think you are hitting the pooled connection issue, and latest version
should fix it, can you give it a try?

BTW, Tomcat is (running) the application, so it knows about the close semantic
(should it be anything other than socket closing), whereas mod_proxy (the
*tunnel*) does not, it can't known about any possible/existing websocket
application passing through.

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #9 from Yann Ylavic <[hidden email]> ---
(In reply to Yann Ylavic from comment #8)
> And if the application is being killed
s/application/browser/

--
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #10 from Ryan <[hidden email]> ---
It does appear that mod_proxy_wstunnel does not handle half-open connections
well.   If you setup Tomcat for websockets and then have a client pull their
network cable Tomcat will get a "connection forcibly closed by the remote host"
error on the session.   Do the same test going through mod_proxy_wstunnel to
get to Tomcat and the server isn't notified of the connection loss.  Worse, the
Session.isOpen() method returns true and sendMessage doesn't throw any
exceptions!   I don't know if this is due to TCP/IP keepalive or what.  Maybe
the proxy server responds that the connection is still alive, but fails to
check with the client.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

Szőgyényi Gábor <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

--- Comment #11 from thomaswollburg <[hidden email]> ---
Might be connected to this, might not:

We had issues with websockets not being connected client side sometimes when
using build 2.4.29-1ubuntu4.12 - but saw the the issue did not exist with
2.4.29-1ubuntu4.11.

Sometimes the issue would occur on a single client right away, sometimes after
some reloading. At the same time the server would answer requests from other
clients as expected.

For us changing to the older version fixed the issue.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 57795] mod_proxy_wstunnel sometimes does not connect and sometimes does not disconnect

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57795

Ian Allison <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]