Prevent IOError occurrences in the logger thread #554
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.
When we're shutting down the add-on, we first send a
shutdown
notification to the runtime server. That will make the process quit, which closes all of the standard pipes from one end.When that happens, if the logger thread tries to execute the
@stderr.gets
call, it will fail with anIOError
because the pipe was closed by the other end.That doesn't actually represent any errors, since we're already shutting down the server. Let's rescue that error so that we don't keep printing unnecessary errors to the output tab.