-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if bundle is valid before restarting #3066
Merged
vinistock
merged 1 commit into
main
from
01-14-check_if_bundle_is_valid_before_restarting
Jan 23, 2025
Merged
Check if bundle is valid before restarting #3066
vinistock
merged 1 commit into
main
from
01-14-check_if_bundle_is_valid_before_restarting
Jan 23, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This stack of pull requests is managed by Graphite. Learn more about stacking. |
vinistock
added
enhancement
New feature or request
vscode
This pull request should be included in the VS Code extension's release notes
labels
Jan 15, 2025
— with
Graphite App
vinistock
force-pushed
the
01-14-check_if_bundle_is_valid_before_restarting
branch
from
January 15, 2025 16:27
9b190ed
to
d123ac4
Compare
vinistock
changed the base branch from
01-15-use_local_executables_when_working_on_the_ruby_lsp
to
graphite-base/3066
January 15, 2025 19:04
vinistock
force-pushed
the
graphite-base/3066
branch
from
January 15, 2025 19:04
21a81e7
to
7fb9adf
Compare
vinistock
force-pushed
the
01-14-check_if_bundle_is_valid_before_restarting
branch
from
January 15, 2025 19:04
d123ac4
to
12d6d3b
Compare
vinistock
force-pushed
the
01-14-check_if_bundle_is_valid_before_restarting
branch
2 times, most recently
from
January 16, 2025 16:02
e2346fd
to
ea13ed2
Compare
vinistock
force-pushed
the
01-14-check_if_bundle_is_valid_before_restarting
branch
from
January 17, 2025 19:19
ea13ed2
to
adf88f7
Compare
andyw8
approved these changes
Jan 23, 2025
vinistock
deleted the
01-14-check_if_bundle_is_valid_before_restarting
branch
January 23, 2025 14:45
vinistock
added a commit
that referenced
this pull request
Jan 23, 2025
### Motivation After #3066 moves forward, we can start getting smarter about our checks of when it's valid to restart. For example, we don't need to go all the way to composing the bundle, if we already know the lockfile's syntax is invalid. ### Implementation Started parsing the lockfile before composing the bundle, so that we can more quickly reject a restart request if there's an issue. ### Automated Tests Added a test.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
vscode
This pull request should be included in the VS Code extension's release notes
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
The more we restart the server, the higher the risk that something related to Bundler may fail and prevent users from having a smooth experience.
I think we can be a bit smarter about when we restart the server by checking if composing the bundle is successful before we try. If we know that composing fails, it's better to continue running the current version of the server than crashing.
Implementation
The proposal is to add a custom request that allows the client to ask the server if composing the bundle succeeds. That way, if there's a lockfile update, we can first check if the update produces a valid bundle.
If we couldn't compose the bundle, then we avoid restarting. Otherwise, we trigger the restart, but skip composing the bundle since we just did that ahead of time - saving time for the user and allow them to skip directly to indexing.
Note
This solution doesn't fully solve #1458, but it does move the needle a little bit at least for VS Code. The big challenge in moving lockfile watching to the server is how to transfer the state of the server currently running to the new instance we launch.
For example, when we receive a notification that the lockfile was changed, we would need to:
exec
)I have not yet figured out how to achieve 3.
Automated Tests
Added tests.