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

Projects
None yet
3 participants
@ancho
Member

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.

shutdown orient database after bake has finished.
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

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls 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.

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();

This comment has been minimized.

@jonbullock

jonbullock Sep 26, 2016

Member

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?

@jonbullock

jonbullock Sep 26, 2016

Member

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?

This comment has been minimized.

@ancho

ancho Sep 26, 2016

Member

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.

@ancho

ancho Sep 26, 2016

Member

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

startup orient db if engines are missing from previous shutdown
This should fix problem occuring using cli watch mode.
@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls 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.

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

This comment has been minimized.

Show comment
Hide comment
@ancho

ancho Sep 26, 2016

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@jonbullock

jonbullock Sep 26, 2016

Member

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

Member

jonbullock commented Sep 26, 2016

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

jonbullock added a commit that referenced this pull request Sep 26, 2016

@ancho ancho deleted the ancho:feature/orientdb-shutdown branch Sep 27, 2016

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