Skip to content
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

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

Closed
wants to merge 3 commits into from

Conversation

balsoft
Copy link
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...

src/libstore/build.cc Outdated Show resolved Hide resolved
src/libstore/build.cc Outdated Show resolved Hide resolved
src/libstore/build.cc Outdated Show resolved Hide resolved
Copy link
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
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
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
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