This patch was authored by @salpieiev and released by @0xTim.
During request body drain each chunk of data may be handled asynchronously. This may lead to a call of handler with .end
parameter before previous call with .buffer(buffer)
finished it's execution.
For example:
- Open new file descriptor
- During
.collected
stage write ByteBuffer on disc using this file descriptor - During
.end
stage close file descriptor
This fix ensures that file descriptor won't be closed until disc write completes