Repository navigation
Conversation
handle_restart() returns true after scheduling an error so the error can be sent to the client, but client_msg_cb() kept handling any messages already in the read buffer. Those ran against the state left behind by the failed restart. Stop the loop once closure->error is set. relay_server_msg_cb() has the same loop and gets the same check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
client_msg_cb() handles every complete ClientMessage in the read buffer in one loop. When a RestartMessage fails, handle_restart() calls schedule_error_message() and then returns true on purpose so the error still reaches the client. The loop never looks at closure->error, though, so any messages the client sent right behind the RestartMessage are still dispatched. They run against whatever the failed restart left in the closure: log_io already set, an evlog without the I/O log files open, and possibly an open iolog_dir_fd.
Stop the loop once an error is pending. The read event is already removed at that point, so this only drops input that was going to be ignored anyway. relay_server_msg_cb() has the same loop, and handle_server_error() also returns true after scheduling an error, so it gets the same check.