Commit 5bad96f
nachumb
GUACAMOLE-2293: Release active connection when guacd socket teardown throws on close.
ActiveConnectionService.deleteObject() only closed the tunnel when
tunnel.isOpen() was true. AbstractGuacamoleTunnel.isOpen() delegates to
the underlying socket, so once the remote peer (e.g. a WebSocket client
that disconnected abruptly behind a proxy/tunnel) is gone, isOpen()
returns false and the kill request becomes a no-op: the
ConnectionCleanupTask never runs, so the in-memory active connection
record and its concurrency seat are never released. The 'Kill session'
UI/REST action then appears to succeed while the ghost session persists.
More fundamentally, ManagedInetGuacamoleSocket.close() and
ManagedSSLGuacamoleSocket.close() ran the socket-closed cleanup task
after super.close() with no finally. When the underlying guacd socket is
being torn down concurrently (the read thread and @onclose both close it),
super.close() can throw (JDK's NIO layer surfaces a spurious IOException
on the second close) and the cleanup task is skipped, leaking the active
connection record even on a normal disconnect.
Always call tunnel.close() on delete (the cleanup task is idempotent),
and run the socket-closed cleanup task in a finally block so cleanup
happens even when closing an already-dead socket throws.1 parent 4e388e4 commit 5bad96f
3 files changed
Lines changed: 20 additions & 6 deletions
File tree
- extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc
- activeconnection
- tunnel
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
125 | 127 | | |
126 | | - | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
0 commit comments