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

shutdown orient database after bake has finished. #296

Merged
merged 2 commits into from Sep 26, 2016

Conversation

ancho
Copy link
Member

@ancho ancho commented Jul 6, 2016

Using a local storage cache with db.store=local throws an exception
rerunning the bake task.

:bake FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bake'.
> Cannot open local storage 'cache' with mode=rw

See stacktrace.

Using a local storage cache with `db.store=local` throws an exception
rerunning the bake tasks.

```
:bake FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bake'.
> Cannot open local storage 'cache' with mode=rw
```

See [stacktrace](https://gist.github.com/ancho/a031859dd4a04f497c91a12a51c09c7f).
@coveralls
Copy link

coveralls commented Jul 6, 2016

Coverage Status

Coverage decreased (-0.1%) to 67.377% when pulling 19c8e43 on ancho:feature/orientdb-shutdown into 2f6bd13 on jbake-org:master.

@@ -174,7 +167,7 @@ public void bake() {
}
} finally {
db.close();
// Orient.instance().shutdown();
Copy link
Member

Choose a reason for hiding this comment

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

This was removed because it caused an issue while running in JBake's watch mode... but the cause of that may have been fixed since.... could you check if this still breaks watch mode?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah ok. Yes I can do that. I'm using jbake in combination with gradle and the continous task runner. Therefor I'm not aware of this breaking the watch mode for the cli.

@jonbullock jonbullock added this to the v2.5.0 milestone Sep 26, 2016
@jonbullock jonbullock self-assigned this Sep 26, 2016
This should fix problem occuring using cli watch mode.
@coveralls
Copy link

coveralls commented Sep 26, 2016

Coverage Status

Coverage increased (+1.7%) to 69.231% when pulling b066a55 on ancho:feature/orientdb-shutdown into 2f6bd13 on jbake-org:master.

@ancho
Copy link
Member Author

ancho commented Sep 26, 2016

Hey Jon, yes it did break. When an instance of the Orient class gets created it calls startup() on the first instantiation. Calling shutdown() does a lot of stuff, like unregister engines.
The easiest solution is to check if count of engines is zero and call Orient.getInstance().startup() to reinitialize the orient database.
It works with watch mode for the cli and with a continuous gradle task.

On the long term it is better to decouple the startup and shutdown of the database from the bake method by passing the ContentStore to the Oven and handle it elsewhere I guess.

@jonbullock
Copy link
Member

Thanks @ancho and I agree this needs to be looked at long term.

@jonbullock jonbullock merged commit b066a55 into jbake-org:master Sep 26, 2016
jonbullock added a commit that referenced this pull request Sep 26, 2016
@ancho ancho deleted the feature/orientdb-shutdown branch September 27, 2016 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants