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

Ugly user presentation when sm.lock exists due to abort #820

Closed
2 tasks
rfay opened this issue Jul 15, 2017 · 1 comment · Fixed by #853
Closed
2 tasks

Ugly user presentation when sm.lock exists due to abort #820

rfay opened this issue Jul 15, 2017 · 1 comment · Fixed by #853

Comments

@rfay
Copy link

rfay commented Jul 15, 2017

What version of Go (go version) and dep (git describe --tags) are you using?

go 1.8.3/osx
dep v0.1.0-215-g911cd22

What dep command did you run?

dep init (or really anything)

What did you expect to see?

Some interesting and informative results.

What did you see instead?

getSourceManager: cache lock file /Users/rfay/go/pkg/dep/sm.lock exists - another process crashed or is still running?

This was a simple result of me debugging through dep init and terminating the session, like a kill -9, but I'm sure it can happen to real people in lots of ways.

It turns out that the lock manager here is rolled for this particular code, and probably should be refactored to use something that is more general and has a fix technique. A slack thread from @sdboyer mentioned this issue, and Patrick Bennet suggested use of https://github.com/nightlyone/lockfile

There are two issues here:

  • Refactor to a generalized lockfile manager
  • Do an appropriate presentation to the user explaining how they can get out of this (minor) hell.
@rfay rfay changed the title Ugly user presentation when lockfile is left around Ugly user presentation when sm.lock exists due to abort Jul 15, 2017
@matjam
Copy link
Contributor

matjam commented Jul 18, 2017

@sdboyer: I am tackling this.

matjam pushed a commit to matjam/dep that referenced this issue Jul 19, 2017
…finish first, and continually retry to lock the lock file. Stale lock files get removed, etc. A little saner. And nicer error messages.
matjam pushed a commit to matjam/dep that referenced this issue Jul 19, 2017
matjam pushed a commit to matjam/dep that referenced this issue Jul 19, 2017
matjam pushed a commit to matjam/dep that referenced this issue Jul 19, 2017
Fix nit around capital letter in error message.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants