Show server crashed dialog on unexpected output in server's stdout #2296
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.
On
int(headers.get("Content-Length"))
crashing inJsonRpcProcessor.read_data
, we've assumed that it's an expected case happening on server exit. As far as I've observed, the typical data we get on process exit is a newline, but it can also be any other random output that doesn't conform to the HTTP header format.In either of those cases we were just silently closing the transport, treating it as expected session shutdown.
Changed so that we only silently exit transport if the stdout was a single newline. In other cases propagate the output to the UI so that a crash dialog is shown.
I've also changed the
JSON decode error
case to also propagate the error to the UI instead of silently ignoring payload. I think this makes more sense but we'd have to see how it works out in practice.Resolves #2295