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

dat should fail gracefully if another dat is already open on that dir #561

Closed
karissa opened this Issue Oct 28, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@karissa
Collaborator

karissa commented Oct 28, 2016

  1. Run a dat in one directory (dat path/to/files)
  2. Open a new terminal
  3. Run a dat on that same directory (dat path/to/files)

It tries to open the db but its already open. It should probably fail gracefully (give a nice message) or use level-party to just open it anyway even though there's another one up already

events.js:160
      throw er; // Unhandled 'error' event
      ^
OpenError: IO error: lock tweet-data/.dat/LOCK: Resource temporarily unavailable
    at /Users/karissa/node_modules/dat/node_modules/levelup/lib/levelup.js:119:34
    at /Users/karissa/node_modules/dat/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16
@mafintosh

This comment has been minimized.

Show comment
Hide comment
@mafintosh

mafintosh Oct 28, 2016

Member

It cannot use level-party. Single master is required.
On Sat, 29 Oct 2016 at 00.46, Karissa McKelvey notifications@github.com
wrote:

  1. Run a dat in one directory (dat path/to/files)
  2. Open a new terminal
  3. Run a dat on that same directory (dat path/to/files)

It tries to open the db but its already open. It should probably fail
gracefully (give a nice message) or use level-party to just open it anyway
even though there's another one up already

events.js:160
throw er; // Unhandled 'error' event
^
OpenError: IO error: lock tweet-data/.dat/LOCK: Resource temporarily unavailable
at /Users/karissa/node_modules/dat/node_modules/levelup/lib/levelup.js:119:34
at /Users/karissa/node_modules/dat/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#561, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAW_VX8dXYZtDRgxVK_xtyrdFRHLdzccks5q4ntWgaJpZM4Kj7oN
.

Member

mafintosh commented Oct 28, 2016

It cannot use level-party. Single master is required.
On Sat, 29 Oct 2016 at 00.46, Karissa McKelvey notifications@github.com
wrote:

  1. Run a dat in one directory (dat path/to/files)
  2. Open a new terminal
  3. Run a dat on that same directory (dat path/to/files)

It tries to open the db but its already open. It should probably fail
gracefully (give a nice message) or use level-party to just open it anyway
even though there's another one up already

events.js:160
throw er; // Unhandled 'error' event
^
OpenError: IO error: lock tweet-data/.dat/LOCK: Resource temporarily unavailable
at /Users/karissa/node_modules/dat/node_modules/levelup/lib/levelup.js:119:34
at /Users/karissa/node_modules/dat/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#561, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAW_VX8dXYZtDRgxVK_xtyrdFRHLdzccks5q4ntWgaJpZM4Kj7oN
.

@karissa

This comment has been minimized.

Show comment
Hide comment
@karissa

karissa Oct 28, 2016

Collaborator

cool lets try to fail gracefully

Collaborator

karissa commented Oct 28, 2016

cool lets try to fail gracefully

@mafintosh

This comment has been minimized.

Show comment
Hide comment
@mafintosh

mafintosh Oct 28, 2016

Member

👍 this is a easy as listening for an error on the leveldb and printing an error message. pr welcome \o/

Member

mafintosh commented Oct 28, 2016

👍 this is a easy as listening for an error on the leveldb and printing an error message. pr welcome \o/

@juliangruber

This comment has been minimized.

Show comment
Hide comment
@juliangruber

juliangruber Nov 1, 2016

Collaborator

Part 1 of the fix is here: datproject/dat-node#28

Collaborator

juliangruber commented Nov 1, 2016

Part 1 of the fix is here: datproject/dat-node#28

@karissa karissa self-assigned this Nov 15, 2016

karissa added a commit that referenced this issue Nov 16, 2016

@joehand joehand closed this in #569 Nov 16, 2016

joehand added a commit that referenced this issue Nov 16, 2016

fail gracefully when dat share is already running fixes #561 (#569)
* fail gracefully when dat share is already running fixes #561

* add test for sharing in same folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment