Break query cycles without spawning a separate thread#155927
Break query cycles without spawning a separate thread#155927zetanumbers wants to merge 3 commits intorust-lang:mainfrom
Conversation
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @nnethercote |
This comment has been minimized.
This comment has been minimized.
Removed unnecessary mutex for cycle errors
852f305 to
b8788ce
Compare
|
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. |
|
The structure I had in mind: |
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.