Skip to content

Improve 'waiting for' message by supplying a reason for the message#3577

Closed
balsoft wants to merge 3 commits intoNixOS:masterfrom
serokell:waiting-for-message
Closed

Improve 'waiting for' message by supplying a reason for the message#3577
balsoft wants to merge 3 commits intoNixOS:masterfrom
serokell:waiting-for-message

Conversation

@balsoft
Copy link
Copy Markdown
Member

@balsoft balsoft commented May 8, 2020

Resolves #2069 by allowing to pass the reason for which we are waiting to Worker::wait* functions.

Implementation details: stores the latest reason for which some DerivationGoal is sleeping in Worker, and if a wait* function is called with a reason different from the previous one, that reason is printed to stderr. Example output:

$ nix build -f test-nix.nix --max-jobs 8 --no-substitute
waiting for build slots...

Copy link
Copy Markdown
Contributor

@yorickvP yorickvP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this print the message at the same points in time as before?

@balsoft
Copy link
Copy Markdown
Member Author

balsoft commented May 8, 2020

No, not exactly. It prints those messages slightly earlier in the code -- right at the time when the wakeup is scheduled, whereas previously it was printed before the thread goes to sleep. However, it shouldn't be much of a difference (if I understand the execution path correctly).

@domenkozar domenkozar requested a review from edolstra May 11, 2020 16:11
@edolstra edolstra closed this in 5ed5d7a Jun 15, 2020
@edolstra
Copy link
Copy Markdown
Member

Thanks, I've gone for a slightly different approach in 5ed5d7a (using Activity to make "waiting for lock" messages show in the progress bar).

@balsoft
Copy link
Copy Markdown
Member Author

balsoft commented Jun 15, 2020

Thanks!

@balsoft balsoft deleted the waiting-for-message branch June 15, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"waiting for locks or build slots" is not a very helpful message

4 participants