#9765 fix race condition that can happen when one thread demands and another thread reads

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2023-05-22 18:32:44 +02:00
parent 152030de09
commit ece6adbd33
1 changed files with 2 additions and 3 deletions

View File

@ -125,9 +125,8 @@ public abstract class HTTP3StreamConnection extends AbstractConnection
case FRAME ->
{
action.getAndSet(null).run();
// Release the network buffer here (if empty), since the application may
// not be reading more bytes, to avoid to keep around a consumed buffer.
tryReleaseBuffer(false);
// Do not release the buffer here to avoid races with
// user-spawned threads that may call Stream.read().
}
}
}