Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Added warning message to the lockfile waiting routine. #958

Merged
merged 2 commits into from
Aug 7, 2017

Conversation

matjam
Copy link
Contributor

@matjam matjam commented Aug 5, 2017

waiting for something, we at least print a message to stderr about it.

Hopefully will make situations like what is described in #947 obvious.

What does this do / why do we need it?

If dep has to wait for the sm.lock file, currently there's no feedback that its waiting. This provides feedback.

What should your reviewer look out for in this PR?

Do you need help or clarification on anything?

Which issue(s) does this PR fix?

may address #947

waiting for something, we at least print a message to stderr about it.

Hopefully will make situations like what is described in golang#947 obvious.
// TODO: #534 needs to be implemented to provide a better way to log warnings,
// but until then we will just use stderr.
//
// #947 appears to be caused by some locking issue; as this is the most likely
Copy link
Member

Choose a reason for hiding this comment

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

the note about #534 is good, but let's drop this one, as it either provides the necessary feedback for #947 on its own (and becomes out of date cruft) or isn't actually the problem (and becomes incorrect cruft).

nowtime := time.Now()
duration := nowtime.Sub(lasttime)

if duration > 15*time.Second {
Copy link
Member

Choose a reason for hiding this comment

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

seems like this will only print after each 15 second window, rather than printing once initially and then again once every 15 seconds, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update the PR, as you're right.

Added spurious comment.
Modified logic to display warning initially, and then every 15 seconds, when lockfile busy.
@matjam
Copy link
Contributor Author

matjam commented Aug 6, 2017

and we close the PR!

@matjam matjam closed this Aug 6, 2017
@matjam
Copy link
Contributor Author

matjam commented Aug 6, 2017

And then open it again ...

@matjam matjam reopened this Aug 6, 2017
Copy link
Member

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

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

cool 👍

@sdboyer sdboyer merged commit 11758a7 into golang:master Aug 7, 2017
@sdboyer
Copy link
Member

sdboyer commented Aug 7, 2017

thanks! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants