Closed gregw closed 1 month ago
This change ensures that all subsequent writes will also fail.
I don't think this would work, because we need to be able to write a response if an idle timeout or a failure happens.
What is the reason behind this change?
@gregw so with the removal of the parameter alwaysFailFutureWrites
(always false
), then writes are not failed.
I don't think failing writes is correct, because we want to be able to write an error response in case of failures or idle timeouts.
@sbordet
@gregw so with the removal of the parameter
alwaysFailFutureWrites
(alwaysfalse
), then writes are not failed.I don't think failing writes is correct, because we want to be able to write an error response in case of failures or idle timeouts.
I'm not understanding your comment? This PR is no longer failing writes after a failure. It did for a while, but after discussions we couldn't convince ourselves that it was right to do so. I'm not entirely convinced it is wrong to do so, but keeping the behaviour the same as currently except ensuring the Runnable is executed is a good step.
Why is it so important to write a response when there is a failure? Most times when this happens, the response will never make it to the client, as the connection will have failed in some way, hence the failure/timeout. I know we have always strived to do this, but I'm wondering what is the value? The cost is that we can sometimes ignore real errors and not deliver them to an application, which then doesn't see those failures on subsequent writes. Perhaps this PR to improve the invocation of error listeners will avoid the problem, but I'm still not 100% sure.
Currently if a handler is idle (or blocked) when an idle timeout occurs, it is essentially a noop, unless the handler has an idle timeout listener, or subsequently reads from the request.
This change ensures that all subsequent writes will also fail.