Open
Description
The current implementation of the NetworkStreamSession acquires the sessionsMutex
and calls close on each stream when closing a session.
With websockets, it may happen that the close call hangs when trying to write c.reads <- streamEOF
within the multiplexedBaseConn
implementation, see here. This may happen when the connection will closed before c.reads
is consumed.
This causes the caller of close to block forever, thus, the sessionMutex
in [NetworkStreamSession] is not released anymore.
One approach to overcome this issue is to perform a non-blocking write to c.reads
and then complete the close()
call.
select {
case c.reads <- streamEOF:
default:
logger.Warnf("cannot send EOF to close connection")
}
Metadata
Metadata
Assignees
Labels
No labels