Skip to content
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

Eagerly compute SHA's for watched files #2861

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Nov 16, 2024

Motivation

This PR fixes two issues related to automated restarts. The first one is preventing undesired restarts immediately after the server finishes booting.

The second one is preventing unwanted restarts if a create event is fired for an existing file. In theory, this shouldn't happen, but our tests tell a different story and we consistently see a create event getting fired for updates.

Implementation

The two fixes are:

  1. Unified all of our watchers to only check the top level configuration files and then started eagerly computing the SHAs for all of them (if they are present). This will prevent unwanted restarts if these files are touched immediately after boot
  2. Started using the hash check for didCreate as well. If the file being updated fires a create event and the content SHA matches

Automated Tests

Added a new test and reduced some of the sleeps on the other test, which is taking a bit too long.

@vinistock vinistock added vscode This pull request should be included in the VS Code extension's release notes bugfix This PR will fix an existing bug labels Nov 16, 2024 — with Graphite App
Copy link
Member Author

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

@vinistock vinistock force-pushed the 11-07-eagerly_compute_sha_s_for_watched_files branch from f3f9236 to ca3945b Compare November 16, 2024 17:09
@vinistock vinistock marked this pull request as ready for review November 16, 2024 17:10
@vinistock vinistock requested a review from a team as a code owner November 16, 2024 17:10
vscode/src/workspace.ts Show resolved Hide resolved
vscode/src/workspace.ts Outdated Show resolved Hide resolved
@vinistock vinistock force-pushed the 11-07-eagerly_compute_sha_s_for_watched_files branch from ca3945b to 130f3fe Compare November 16, 2024 17:13
@vinistock vinistock force-pushed the 11-07-eagerly_compute_sha_s_for_watched_files branch from 130f3fe to bc9322f Compare November 16, 2024 17:16
vscode/src/workspace.ts Outdated Show resolved Hide resolved
@vinistock vinistock force-pushed the 11-07-eagerly_compute_sha_s_for_watched_files branch from bc9322f to c5de676 Compare November 19, 2024 17:25
@vinistock vinistock force-pushed the 11-07-eagerly_compute_sha_s_for_watched_files branch from c5de676 to cd57b1d Compare November 19, 2024 17:50
@vinistock vinistock merged commit 7d067e5 into main Nov 19, 2024
37 checks passed
Copy link
Member Author

Merge activity

  • Nov 19, 1:17 PM EST: A user merged this pull request with Graphite.

@vinistock vinistock deleted the 11-07-eagerly_compute_sha_s_for_watched_files branch November 19, 2024 18:17
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 vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants