Only schedule another read if the FD is still open (#10551)

Motivation:

We should only keep on reading if the fd is still open, otherwise we
will produce a confusing exception

Modifications:

check if fd is still open before schedule the read.

Result:

Dont produce a confusing excepion when the fd was closed during a read
loop.
This commit is contained in:
Norman Maurer 2020-09-09 11:43:46 +02:00 committed by GitHub
parent 8ef5dbc24b
commit 044ec159b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -520,7 +520,8 @@ abstract class AbstractIOUringChannel extends AbstractChannel implements UnixCha
}
protected final void scheduleRead() {
if (delayedClose == null) {
// Only schedule another read if the fd is still open.
if (delayedClose == null && fd().isOpen()) {
ioState |= READ_SCHEDULED;
scheduleRead0();
}