-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Handle race when coloring nodes concurrently as both green and red #151509
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
base: main
Are you sure you want to change the base?
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Handle race when coloring nodes concurrently as both green and red
|
Looks fairly neutral locally.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Here's what's bugging me. I'm under the impression that this PR allows a node to change colour from green to red. It should not. A node has a single colour and should never change. So my recommendation would be:
|
This comment has been minimized.
This comment has been minimized.
Wouldn't #150156 already address these concerns? |
|
Finished benchmarking commit (f9b6979): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.9%, secondary -5.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.794s -> 471.369s (-0.51%) |
No, that's the current state of rustc. This PR prevents that. |
|
I honestly feel like @Zoxc often deals with his own meaning of compiler's code and not the code's actual behavior. It comes up when I try to convince him about anything. |
|
Would demonstrating what the code does help resolve this discussion? |
|
As discussed in Solving big #141540 issue and hunt for bad metadata files, I think the trait selection cache can leave nodes uncolored after execution. This means that we're not able to tell if dependencies are all green in all cases and #150156 would be insufficient to fix the race. |
|
☔ The latest upstream changes (presumably #151881) made this pull request unmergeable. Please resolve the merge conflicts. |
This fixes a race where a duplicate dep node gets written to the dep graph if a node was marked as green and promoted during execution, then marked as red after execution.
This can occur when a
no_hashquery A depends on a query B which cannot be forced so it was not colored when starting execution of query A. During the execution of query A it will execute query B and color it green. Before A finishes another thread tries to mark A green, this time succeeding as B is now green, and A gets promoted and written to metadata. Execution of A then finishes and because it'sno_hashwe assume the result changed and thus we color the node again, now as red and write it to metadata again. This doesn't happen with non-no_hashqueries as they will be green if all their dependencies are green.This changes the code coloring nodes red to also use
compare_exchangeto deal with this race ensuring that the coloring of nodes only happens once.r? @ghost