Skip to content

Conversation

@vinistock
Copy link
Member

@vinistock vinistock commented Jul 9, 2025

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 the install_error file and then the process exists soon after.

The next time the language server is booted, it sees that the install_error file 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::EPIPE when running bundle install and clearing the install_error file, so that we don't report this scenario to telemetry and simply shutdown gracefully.

Automated Tests

Added a test to verify that the install_error file is not created when one of these happen.

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock self-assigned this Jul 9, 2025
@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Jul 9, 2025 — with Graphite App
@vinistock vinistock marked this pull request as ready for review July 9, 2025 19:14
@vinistock vinistock requested a review from a team as a code owner July 9, 2025 19:14
Copy link
Contributor

@egiurleo egiurleo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woohoo!

@vinistock vinistock merged commit 55d41b1 into main Jul 9, 2025
38 checks passed
@vinistock vinistock deleted the 07-09-avoid_writing_error_file_if_client_is_closed_during_bundle_compose branch July 9, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants