The content of getActiveConnections() within AbstractGuacamoleTunnelService currently does the following:
- Check if there are zero active connections. If there aren't any, just return an empty set.
- Produce the set of connection identifiers associated with all active connections. <-- race condition
- Retrieve the subset of those connection identifiers that are actually readable.
There is a race condition here, as the set of active connections is a live, concurrently-modifiable map. If there are active connections at the beginning, but all of those connections disconnect prior to producing the set of connection identifiers, then the set of identifiers will be empty. When this empty set is passed to the selectReadable() query that follows, an internal error will result:
Though the above has been reported several times as a possible cause of failures to connect to remote desktops, this error does not actually result in connection failure. Its association with connection failures is a red herring, and it has been confirmed that intentionally causing this error will not result in an otherwise functional connection failing. It is simply more likely for this error to occur if connections are failing on their own.