On Sun, Jan 12, 2020 at 2:31 PM Nick Couchman <[email protected]> wrote:

> On Thu, Jan 2, 2020 at 2:25 AM Umesh Bhatt <[email protected]> wrote:
>
> > Hi,
> >
> > I have custom auth provider and when we close the tab to close a
> > connection I am getting following error in the log.
> > Is there any event which is fired when connection is closed so that I can
> > handle it more gracefully in my auth provider?
> >
> > 12:51:34.973 [Thread-3] DEBUG o.a.g.w.GuacamoleWebSocketTunnelEndpoint -
> > Connection to guacd closed.
> > org.apache.guacamole.GuacamoleConnectionClosedException: Connection to
> > guacd is closed.
> >                 at org.apache.guacamole.io
> .ReaderGuacamoleReader.read(ReaderGuacamoleReader.java:183)
> > ~[guacamole-common-1.0.0.jar:na]
> >                 at org.apache.guacamole.io
> .ReaderGuacamoleReader.readInstruction(ReaderGuacamoleReader.java:195)
> > ~[guacamole-common-1.0.0.jar:na]
> >                 at
> >
> org.apache.guacamole.protocol.FilteredGuacamoleReader.readInstruction(FilteredGuacamoleReader.java:81)
> > ~[guacamole-common-1.0.0.jar:na]
> >                 at
> >
> org.apache.guacamole.protocol.FilteredGuacamoleReader.readInstruction(FilteredGuacamoleReader.java:81)
> > ~[guacamole-common-1.0.0.jar:na]
> >                 at
> >
> org.apache.guacamole.protocol.FilteredGuacamoleReader.read(FilteredGuacamoleReader.java:64)
> > ~[guacamole-common-1.0.0.jar:na]
> >                 at
> >
> org.apache.guacamole.websocket.GuacamoleWebSocketTunnelEndpoint$2.run(GuacamoleWebSocketTunnelEndpoint.java:246)
> > ~[guacamole-common-1.0.0.jar:na]
> > Caused by: java.net.SocketException: Socket closed
> >                 at
> > java.net.SocketInputStream.read(SocketInputStream.java:204)
> ~[na:1.8.0_232]
> >                 at
> > java.net.SocketInputStream.read(SocketInputStream.java:141)
> ~[na:1.8.0_232]
> >                 at
> > sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
> ~[na:1.8.0_232]
> >                 at
> > sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) ~[na:1.8.0_232]
> >                 at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
> > ~[na:1.8.0_232]
> >                 at
> > java.io.InputStreamReader.read(InputStreamReader.java:184)
> ~[na:1.8.0_232]
> >                 at org.apache.guacamole.io
> .ReaderGuacamoleReader.read(ReaderGuacamoleReader.java:169)
> > ~[guacamole-common-1.0.0.jar:na]
> >                 ... 5 common frames omitted
> >
> >
> There are some events within Guacamole that deal with tunnel close events,
> but handling that event within your authentication extension is likely not
> going to get rid of these messages.  If you simply close the tab you will
> almost certainly see them.  The only way to avoid this is to have users
> properly "disconnect" from the system before closing the tab.  It's not a
> huge deal either way - it's just Guacamole's way of telling you that it
> detected a close outside of the normal bounds of connection management,
> which can either indicate a problem, or can just be something like this.
>

Yep. The exception is unavoidable, as it's impossible to guarantee that
there aren't packets already on their way to the webapp after the server
has decided to close the connection, nor that everything on the client side
will know that the connection has been closed in time to avoid sending more
data.

Logging of this exception is at the debug level because it's conceivably
useful when debugging, but would likely otherwise cause confusion and isn't
useful under normal circumstances. The presence of the exception isn't an
error, as it's actually already being cleanly handled. All you're seeing
here is additional, debug-level information about the error that was
cleanly handled.

- Mike

Reply via email to