Avoid writing error file if client is closed during bundle compose #3649
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.

Motivation
This PR addresses one of the telemetry errors we see when using the new launcher mode. If the editor is closed while we're in the middle of composing the bundle, the server is not yet fully booted and cannot respond to shutdown requests.
If the client disconnects, closing their ends of the stdio pipes, the bundle install process may continue to try writing output to stderr, which results in raising
Errno::EPIPE. When the error is raised, we write that error to theinstall_errorfile and then the process exists soon after.The next time the language server is booted, it sees that the
install_errorfile is there and reports that as an error, but this situation doesn't actually indicate a bug. It just means the user closed the editor before we were done composing the bundle. The next time they open it, we'll compose from scratch.Implementation
Started rescuing
Errno::EPIPEwhen running bundle install and clearing theinstall_errorfile, so that we don't report this scenario to telemetry and simply shutdown gracefully.Automated Tests
Added a test to verify that the
install_errorfile is not created when one of these happen.