Migrate jobserver-error run-make test to rmake by Oneirical · Pull Request #128789 · rust-lang/rust (original) (raw)

FWIW, we might actually just delete the disabled part of this test cc #110321.

The problem is that the jobserver helper thread launched here gets starved out and doesn't run, while the coordinator thread continually processes work using the implicit jobserver token, never yielding long enough for the jobserver helper to do its work (and process the error).

Honestly, I'm not sure this is really worth fixing. It would be nice to have a test to validate the jobserver behavior, but I'm not sure it is worth the expense of changing the coordinator's behavior in some way (since there could be performance losses, for example if it explicitly yielded or waited for the jobserver helper, or more aggressively tried to acquire tokens). I'm not familiar enough with Linux thread scheduling to know why the thread could get blocked for so long, or if there are different approaches to fix the scheduling.

Another thought I just had would be to change the test to generate a binary with enough code to split across a very large number of CGUs (and use -C codegen-units=…). That would ensure that the coordinator does a lot of work, giving it more opportunity to yield. Again, I'm not too familiar with Linux thread scheduling, so I don't know if that would help, but might be worth a shot.