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 suggestions loading after the reconnect #9043

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Feb 13, 2024

Pull Request Description

related #8689

Fixes a race between the language server SQL updating logic and the engine DeserializeLibrarySuggestionsJobs when the library suggestions may start loading before the database is properly cleaned up after the reconnect.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Feb 13, 2024
@4e6 4e6 self-assigned this Feb 13, 2024
Copy link
Contributor

@hubertp hubertp left a comment

Choose a reason for hiding this comment

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

I would be grateful for some clarification

@@ -33,6 +32,7 @@ public Future<BoxedUnit> executeAsynchronously(RuntimeContext ctx, ExecutionCont
TruffleLogger logger = ctx.executionService().getLogger();
long writeCompilationLockTimestamp = ctx.locking().acquireWriteCompilationLock();
try {
ctx.jobControlPlane().stopBackgroundJobs();
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this confusing - we stop all background jobs only to abort some of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It may look like an overkill. But here we stop running new background jobs for a brief moment to ensure that the deserialization jobs will not be executed before we clean the suggestions database. After the database is cleaned, we re-start the background jobs processing.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Feb 13, 2024
@mergify mergify bot merged commit 9c982e0 into develop Feb 13, 2024
27 of 29 checks passed
@mergify mergify bot deleted the wip/db/8689-sync-suggestions-loading branch February 13, 2024 17:52
hubertp added a commit that referenced this pull request Feb 15, 2024
4e6 added a commit that referenced this pull request Feb 22, 2024
related #8689

Fixes a race between the language server SQL updating logic and the engine `DeserializeLibrarySuggestionsJob`s when the library suggestions may start loading before the database is properly cleaned up after the reconnect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants