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

Bitcask should not call application:start(bitcask) when opening a cask #40

Closed
dreverri opened this issue Mar 16, 2012 · 2 comments
Closed

Comments

@dreverri
Copy link
Contributor

Bitcask calls application:start(bitcask) every time bitcask:open/1,2 is called:
https://github.com/basho/bitcask/blob/master/src/bitcask.erl#L92
https://github.com/basho/bitcask/blob/master/src/bitcask.erl#L714

The responsibility for loading/starting the bitcask application should lie with the application which is using bitcask.

The current implementation can cause problems for applications, such as Riak, that open casks without blocking the main application's start up. For example, in Riak, the call to application:start(bitcask) within a vnode can deadlock with init:stop(). When processing init:stop() the application controller will wait for vnodes to shutdown. If the vnodes are still starting when init:stop() is called they will block on the call to application:start(bitcask). The deadlock eventually times out, after 5 minutes, and the application controller can complete the shutdown of Riak.

Steps to reproduce:

  1. Run riak start; riak stop
  2. Repeat step 1 until riak stop hangs for about 5 minutes
@dizzyd
Copy link
Contributor

dizzyd commented Mar 19, 2012

Agreed. That call to start_app should just validate that the app has been started and return {error, {not_started, bitcask}} if not.

@ghost ghost assigned bookshelfdave May 17, 2012
@slfritchie
Copy link
Contributor

I'm going to close this one: Bitcask now has a supervisor and worker processes under that supervisor that are required for Bitcask operation.

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

No branches or pull requests

4 participants