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

Synchronize store operations in server instead #3029

Merged

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Jan 9, 2025

Motivation

Closes #3027

The deadlock bug was introduced in #2976. Essentially, if the editor opens a URI for a non-existing file, we try to acquire the same lock twice.

Once here to verify if the request requires a document to be parsed and the second time here when we read the file from disk and save it in the store.

Trying to acquire the same mutex lock twice raises the deadlock error.

Implementation

I stopped synchronizing anything inside basic store operations. It just increases the chance of mistakes like these. I moved the responsibility of synchronizing back to the server.

Automated Tests

To catch this regression, we need a client/server integration test because the first synchronization happens only by reading a request from the STDIN pipe. I added one to ensure we don't hit the same issue again.

Copy link
Member Author

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

Trying to synchronize inside the store is a mistake
because it may lead to deadlocks. We need the server
to control this aspect
@vinistock vinistock force-pushed the 01-09-synchronize_store_operations_in_server_instead branch from e46a81a to 135d551 Compare January 9, 2025 14:38
@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 Jan 9, 2025 — with Graphite App
@vinistock vinistock requested review from andyw8 and st0012 January 9, 2025 14:40
@vinistock vinistock marked this pull request as ready for review January 9, 2025 14:40
@vinistock vinistock requested a review from a team as a code owner January 9, 2025 14:40
@vinistock vinistock merged commit af45f85 into main Jan 9, 2025
43 of 44 checks passed
Copy link
Member Author

Merge activity

  • Jan 9, 10:04 AM EST: A user merged this pull request with Graphite.

@vinistock vinistock deleted the 01-09-synchronize_store_operations_in_server_instead branch January 9, 2025 15:04
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.

Crash when used in combination with GitHub Pull Requests extension
2 participants