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

Fix race condition when emitting stored diagnostics #57066

Merged
merged 1 commit into from Jan 24, 2019

Conversation

Projects
None yet
8 participants
@Zoxc
Copy link
Contributor

Zoxc commented Dec 22, 2018

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 26, 2018

☔️ The latest upstream changes (presumably #57108) made this pull request unmergeable. Please resolve the merge conflicts.

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Jan 7, 2019

Can you explain to me how this is racy? Loaded diagnostics are only emitted by the thread that actually allocates the dep-node and that is already synchronized.

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Jan 8, 2019

try_mark_green is expected to emit diagnostics before returning, but that only happens if we are on the thread which did the dep-node allocation. Other threads may continue executing and emit their own diagnostics before the thread which did the dep-node allocation, giving a wrong order to the emitted diagnostics.

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Jan 9, 2019

Yeah, true. However, I'm not sure how much we can avoid diagnostics re-ordering in general with parallel queries. Or, put differently, we'll have to put some machinery in place to make things more deterministic and that might (1) clash with this incr.comp. specific approach and (2) it might handle this case with the extra logic.
I'd opt for putting this on hold until we figure out the concurrency&diagnostics story more generally.

@TimNN

This comment has been minimized.

Copy link
Contributor

TimNN commented Jan 22, 2019

Ping from triage @Zoxc / @michaelwoerister: What is the status of this PR? Is it blocked on something for the foreseeable future?

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Jan 23, 2019

I'm actually fine with merging it the way it is. The code will probably change in the medium term but it doesn't hurt to have this behaving correctly in the meantime.

r=me with the conflicts resolved.

@Zoxc Zoxc force-pushed the Zoxc:graph-race branch from c9d8eaa to b2dfd96 Jan 23, 2019

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Jan 23, 2019

@bors r=michaelwoerister

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 23, 2019

📌 Commit b2dfd96 has been approved by michaelwoerister

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 23, 2019

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

Centril added a commit to Centril/rust that referenced this pull request Jan 24, 2019

Rollup merge of rust-lang#57066 - Zoxc:graph-race, r=michaelwoerister
Fix race condition when emitting stored diagnostics

r? @michaelwoerister

bors added a commit that referenced this pull request Jan 24, 2019

Auto merge of #57874 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57066 (Fix race condition when emitting stored diagnostics)
 - #57606 (Get rid of the fake stack frame for reading from constants)
 - #57734 (Fix evaluating trivial drop glue in constants)
 - #57846 (rustdoc: fix ICE from loading proc-macro stubs)
 - #57860 (Add os::fortanix_sgx::ffi module)
 - #57861 (Don't export table by default in wasm)
 - #57863 (Add suggestion for incorrect field syntax.)
 - #57867 (Fix std::future::from_generator documentation)
 - #57873 (Stabilize no_panic_pow)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 24, 2019

⌛️ Testing commit b2dfd96 with merge e44e541...

bors added a commit that referenced this pull request Jan 24, 2019

Auto merge of #57066 - Zoxc:graph-race, r=michaelwoerister
Fix race condition when emitting stored diagnostics

r? @michaelwoerister
@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Jan 24, 2019

@bors retry

yielding prio to rollup in which this is included.

bors added a commit that referenced this pull request Jan 24, 2019

Auto merge of #57874 - Centril:rollup, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #57066 (Fix race condition when emitting stored diagnostics)
 - #57606 (Get rid of the fake stack frame for reading from constants)
 - #57734 (Fix evaluating trivial drop glue in constants)
 - #57846 (rustdoc: fix ICE from loading proc-macro stubs)
 - #57860 (Add os::fortanix_sgx::ffi module)
 - #57861 (Don't export table by default in wasm)
 - #57863 (Add suggestion for incorrect field syntax.)
 - #57867 (Fix std::future::from_generator documentation)
 - #57873 (Stabilize no_panic_pow)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 24, 2019

⌛️ Testing commit b2dfd96 with merge f23b63c...

bors added a commit that referenced this pull request Jan 24, 2019

Auto merge of #57066 - Zoxc:graph-race, r=michaelwoerister
Fix race condition when emitting stored diagnostics

r? @michaelwoerister
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 24, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: michaelwoerister
Pushing f23b63c to master...

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 24, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: michaelwoerister
Pushing f23b63c to master...

@bors bors merged commit b2dfd96 into rust-lang:master Jan 24, 2019

1 check passed

homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment