Avoid yielding messages on GeneratorExit in sync server #90
+596
−448
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.
gunicorn continues to be flaky so I did some more investigating of the sync server code to see if anything stands out. I realized that the log spam we see on client disconnect is because of yielding in a
finallyblock which will run even on exit. It was better to not usefinallyto make sure we only yield a final message on normal exceptions, notBaseException.That doesn't fix flakiness but just removes the log spam, in the end I realized I had tried many different low and high values for keep-alive but never tried disabling it. I think it may be more stable with it disabled, and then went back to the more lightweight worker class. We'll see how this goes, but worst case is it's still as flaky as now. Will see how it goes, and as a last resort allow failures to unblock CI in the future since we have other servers to verify with.