-
Notifications
You must be signed in to change notification settings - Fork 814
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
TINKERPOP-2950 Add docker shutdown handling to close containers gracefully #2397
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.6-dev #2397 +/- ##
=============================================
- Coverage 75.19% 75.19% -0.01%
- Complexity 12318 12319 +1
=============================================
Files 1057 1057
Lines 63450 63450
Branches 6935 6935
=============================================
- Hits 47713 47709 -4
- Misses 13169 13176 +7
+ Partials 2568 2565 -3 ☔ View full report in Codecov by Sentry. |
Thanks Ryan, I checked out the branch and tested out the new image, it's working great! VOTE +1 |
VOTE +1 |
1 similar comment
VOTE +1 |
I'm still having issues with graceful shutdown even with this code. I use the default scripts/empty-sample.groovy which has: globals << [hook : [
onStartUp: { LifeCycleHook.Context ctx ->
ctx.logger.info("Executed once at startup of Gremlin Server.")
},
onShutDown: { LifeCycleHook.Context ctx ->
ctx.logger.info("Executed once at shutdown of Gremlin Server.")
graph.close() // <-- I ADDED THIS
}
] as LifeCycleHook] And |
This is an issue for me as well. It seems that docker-entrypoint.sh forwards SIGTERMS as SIGINTS to /opt/gremlin-server/bin/gremlin-server.sh but it's ignored there. What needs to be sent the signal instead is the java process that gremlin-server.sh starts. |
I'm seeing the same behaviour as well now. The change here is preventing docker from hanging due to @danielcweber As you've already dug into this, would you be willing to submit a PR with a fix? If not let's reopen the JIRA for tracking and ensure it gets fixed for the next release. |
I'm basically clueless about bash files but I'll give it a try nonetheless. |
@Cole-Greer My naive attempt that is working for me would be this change. This is not even PR quality because I don't know what this will break for other users. Basically, through this change, the 'java' process will end up as PID 1 and receive all the signals. |
Thanks @danielcweber. I don't see anything that would break just from looking at the code. I will find some time to run some tests with it, if everything checks out I think we can merge that in. |
@Cole-Greer If everything is fine, here's a PR. |
JIRA: https://issues.apache.org/jira/browse/TINKERPOP-2950. Handles SIGTERM when shutting down docker container by sending SIGINT to server processes.