Skip to content

Non-deterministic overflow in rustc_thread_pool causing CI failures #90227

Activity

  1. changed the title [-]Non-deterministic overflows in rustc-rayon-core causing CI failures[/-] [+]Non-deterministic overflow in rustc-rayon-core causing CI failures[/+] on Oct 24, 2021
  2. hkratz commented on Oct 24, 2021

    @hkratz
    ContributorAuthor

    @rustbot label +T-compiler +A-parallel-queries

  3. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Oct 24, 2021
  4. added a commit that references this issue on Oct 24, 2021
  5. hkratz commented on Oct 24, 2021

    @hkratz
    ContributorAuthor

    Interestingly enough the errors only appeared on Windows, in rustdoc and in builds which don't have the parallel queries enabled. So I guess Rustdocs use of rustc-rayon triggers it?

    if !self.sync_only && cfg!(windows) {
    // A possible future enhancement after more detailed profiling would
    // be to create the file sync so errors are reported eagerly.
    let sender = self.errors.clone().expect("can't write after closing");
    rayon::spawn(move || {
    fs::write(&path, contents).unwrap_or_else(|e| {
    sender.send(format!("\"{}\": {}", path.display(), e)).unwrap_or_else(|_| {
    panic!("failed to send error on \"{}\"", path.display())
    })
    });
    });
    } else {

  6. camelid commented on Oct 27, 2021

    @camelid
    Member

    cc @jyn514 since IIRC you were looking into the DocFS code at some point recently

  7. jyn514 commented on Oct 27, 2021

    @jyn514
    Member

    I don't have any insight here, I think this just happens to be the only part of the compiler using rayon when cfg(parallel_compiler) is disabled.

  8. Mark-Simulacrum commented on Oct 27, 2021

    @Mark-Simulacrum
    Member

    Hm... I would suggest that rustdoc probably wants to use mainline rayon here, rather than rustc's fork of it, since I/O code likely doesn't want to interop with jobserver and such. I don't know whether that will fix this particular issue, but it seems like a good idea.

  9. jyn514 commented on Oct 27, 2021

    @jyn514
    Member

    @Mark-Simulacrum what jobserver are you referring to here? I don't know what the differences between mainline rayon and rustc's fork are.

  10. Mark-Simulacrum commented on Oct 27, 2021

    @Mark-Simulacrum
    Member

    The fork is primarily intended to interface with the jobserver that Cargo creates (though I don't know that rustdoc ever configures it as such) to ensure that rayon's worker threads are not using more than the allocated share of CPU resources. This is the same jobserver that manages e.g. LLVM parallelism within each rustc compilation, for example, to ensure there's at most "ncpu" threads running at the same time.

    For I/O heavy work like this, I'd expect that you don't want that - your threads are mostly blocked on I/O completion which is not CPU-heavy for the most part.

  11. added a commit that references this issue on Oct 29, 2021
  12. 13 remaining items

  13. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    on Jun 19, 2026
  14. added 2 commits that reference this issue on Aug 18, 2026
    5d558b6
    0e0ee23
  15. added 2 commits that reference this issue on Aug 19, 2026
    10815a5
    9fb1320
  16. added a commit that references this issue on Aug 19, 2026
    ef6babe
  17. petrochenkov commented on Aug 19, 2026

    @petrochenkov
    Contributor

    Reopening, this only can be closed if #161296 is not reverted in a month or so.

  18. added a commit that references this issue on Aug 19, 2026
    0ab6d4e
  19. added a commit that references this issue on Aug 20, 2026
    6f5c6da
  20. reopened this on Aug 20, 2026
  21. aerooneqq commented on Oct 9, 2026

    @aerooneqq
    Contributor

    Reopening, this only can be closed if #161296 is not reverted in a month or so.

    Almost two months have passed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parallel-compilerArea: parallel compilerI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions