Break query cycles without spawning a separate thread#155927
Open
zetanumbers wants to merge 3 commits intorust-lang:mainfrom
Open
Break query cycles without spawning a separate thread#155927zetanumbers wants to merge 3 commits intorust-lang:mainfrom
zetanumbers wants to merge 3 commits intorust-lang:mainfrom
Conversation
Collaborator
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
Author
|
r? @nnethercote |
This comment has been minimized.
This comment has been minimized.
Removed unnecessary mutex for cycle errors
852f305 to
b8788ce
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR removes separate thread for query cycle breaking. Essentially I made sure that behavior right before a block is done before deadlock handler is called.
TODO: explain in a comment that we use
CurrentGcxin case worker thread no longer has any tasks to execute and triggers a deadlock handler, which means there's noImplicitCtxtset to extract tcx from.While this code is very unpolished at the moment and introduces some test failures due to diagnostics, it's a proof of concept and a place for feedback. I plan to make query cycle handling blocking of all worker threads in order to add something like a
WorkerLocal::as_deadlockedto return every worker-local value in future. This is one of the stepping stones to remake query state hash table withQueryJob's into something more worker-thread-local.Blocked on #155881.