while ((record = poll()) != null) {
record.notifyFailure(error);
}
}
WriteHandler writeHandler;
while ((writeHandler = pollWriteHandler()) != null) {
if (error == null) {
error = new IOException("Connection closed", cause);
}
writeHandler.onError(error);
}
}