EPoll error capture - store in NetEvent for later processing. #7803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Testing some HostDB issues, it turns out that if there is an error reported
epollthat is simply dropped on the floor and the error isn't detected until a subsequent I/O operation. The best way to handle this is debatable, but it was agreed the first step is to store the error in a way that can be found in later processing.With the current code if the socket is being checked for being writable, on error
epollwill report both writable and error. Because the error indication is dropped, this generates aWRITE_READYas if there were no error. This in turn causes the state machine to validate the TCP handshake even though it did not occur, which means the subsequent error on writing the proxy request causes a 502 response to the user agent but has no effect on marking the upstream as dead.@shinrich notes that we may want to handle this differently for read vs. write, because in a read situation there may be useful data on the socket, but that's never the case for a write. Therefore it might be reasonable to ignore the error for read, but signal it for write.