Avoid leaking the query-job collection warning into the panic query stack#157351
Conversation
`collect_active_query_jobs` with `CollectActiveJobsKind::PartialAllowed` is only used to print the query stack when the compiler panics. It intentionally skips any query state shard whose lock it cannot take without waiting, since a complete job map is not needed for that. Under the parallel front-end another thread can still hold a shard lock while the panic is being reported, so the skip happens nondeterministically and the `warn!` was printed into the panic output. Because warnings are shown by default, this leaked a "Failed to collect active jobs" line into the diagnostics of panicking compilations and made their output unstable. Lower the message to `debug!` so it stays available with `RUSTC_LOG` but no longer pollutes the default output.
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
…nt-end This test was marked ignore-parallel-frontend because the panic-time query stack collection could nondeterministically print a "Failed to collect active jobs" warning. With that warning lowered to debug! the ICE output is stable across runs, so replace the directive with a blank line rather than deleting it. The expected stderr is unchanged because the line numbers stay the same.
f2efaa9 to
b6a2d84
Compare
|
@bors r+ rollup |
…arn, r=petrochenkov Avoid leaking the query-job collection warning into the panic query stack Part of rust-lang#154314. When the compiler panics it prints the active query stack. That collection runs with `CollectActiveJobsKind::PartialAllowed`, which deliberately skips any query state shard whose lock it cannot take without waiting, since a complete job map is not needed just to print a stack. Under the parallel front-end another thread can still hold a shard lock while the panic is being reported, so a shard is skipped nondeterministically and a `warn!("Failed to collect active jobs ...")` was printed. Because warnings are shown by default (the default `RUSTC_LOG` filter is `WARN`), this leaked an extra line into the diagnostics of panicking compilations and made their output differ run to run. The panicking thread's own query chain is always collectible (a query does not hold its shard lock while it runs), so the printed stack itself is unaffected; only the spurious warning varied. A skipped shard is expected and tolerated on this path, so `warn!` was the wrong level for it to begin with. This lowers the message to `debug!` so it stays available with `RUSTC_LOG` but no longer pollutes the default output, and re-enables the one ui test that was disabled because of it.
Rollup of 12 pull requests Successful merges: - #157085 (powerpc: warn against incorrect values for ABI-relevant target features) - #157170 (Use `impl` restrictions in `std`, `core`) - #157217 ([tiny] remove unecessary `.into()` calls) - #157262 (rustdoc: IXCRE: Preserve sizedness bounds on type params belonging to the parent item) - #157379 (Some more simple per-owner resolver changes) - #157381 (librustdoc: fix CSS border issue to support Firefox high contrast mode) - #155512 (interpreter: improve comments and error message in mir_assign_valid_types) - #157254 (Correct description of panic.rs) - #157290 (interpret: fix mir::UnOp layout computation) - #157332 (Rewrite target checking for `#[sanitize]`) - #157351 (Avoid leaking the query-job collection warning into the panic query stack) - #157389 (Add @clarfonthey to libs review rotation)
Rollup merge of #157351 - xmakro:fix/parallel-collect-jobs-warn, r=petrochenkov Avoid leaking the query-job collection warning into the panic query stack Part of #154314. When the compiler panics it prints the active query stack. That collection runs with `CollectActiveJobsKind::PartialAllowed`, which deliberately skips any query state shard whose lock it cannot take without waiting, since a complete job map is not needed just to print a stack. Under the parallel front-end another thread can still hold a shard lock while the panic is being reported, so a shard is skipped nondeterministically and a `warn!("Failed to collect active jobs ...")` was printed. Because warnings are shown by default (the default `RUSTC_LOG` filter is `WARN`), this leaked an extra line into the diagnostics of panicking compilations and made their output differ run to run. The panicking thread's own query chain is always collectible (a query does not hold its shard lock while it runs), so the printed stack itself is unaffected; only the spurious warning varied. A skipped shard is expected and tolerated on this path, so `warn!` was the wrong level for it to begin with. This lowers the message to `debug!` so it stays available with `RUSTC_LOG` but no longer pollutes the default output, and re-enables the one ui test that was disabled because of it.
|
Why did you remove this warning? This only relates to the test that you @petrochenkov admit has a misleading diagnostic message for a broken incomplete feature and you are trying to make it more stable at the cost of suppressing this warning?! You don't understand what this warning indicates as it is emitted only when the compiler is in a broken state. |
Part of #154314.
When the compiler panics it prints the active query stack. That collection runs with
CollectActiveJobsKind::PartialAllowed, which deliberately skips any query state shard whose lock it cannot take without waiting, since a complete job map is not needed just to print a stack.Under the parallel front-end another thread can still hold a shard lock while the panic is being reported, so a shard is skipped nondeterministically and a
warn!("Failed to collect active jobs ...")was printed. Because warnings are shown by default (the defaultRUSTC_LOGfilter isWARN), this leaked an extra line into the diagnostics of panicking compilations and made their output differ run to run. The panicking thread's own query chain is always collectible (a query does not hold its shard lock while it runs), so the printed stack itself is unaffected; only the spurious warning varied.A skipped shard is expected and tolerated on this path, so
warn!was the wrong level for it to begin with. This lowers the message todebug!so it stays available withRUSTC_LOGbut no longer pollutes the default output, and re-enables the one ui test that was disabled because of it.