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 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
balsoft and others added 2 commits May 8, 2020
Co-authored-by: Kirill Elagin <kirelagin@gmail.com>
Copy link
Contributor

yorickvP left a comment

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
@edolstra edolstra closed this in 5ed5d7a Jun 15, 2020
@edolstra
Copy link
Member

edolstra commented Jun 15, 2020

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 serokell:waiting-for-message branch Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.