-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Dgraph should handle shutdown gracefully #3873
Comments
I saw the same error yesterday while running badger. |
In case of the failure that I observed, the error was thrown because DB was being closed when a transaction was active. It's possible that Dgraph too is trying to close DB on CTRL-C while a transaction was still active. |
I've moved the issue to dgraph from badger. The error was caused in dgraph because dgraph tried to close badger when a transaction was active. |
This is not a new issue, requires some big changes - moving to next release. |
Potentially fixed by #4356 |
Let's test with 20.03.0-beta. By adding a long sleep here, triggering that code and calling Ctrl+C. I think that goroutine does get shutdown gracefully, not sure why we're seeing this above issue. |
I see 3 possible reasons for alpha crash while shutting down. In all the cases, we close badger before the operation completes. Dgraph could crash at the following places
|
The background reindexing starts indexing in the background but we do not wait for the indexing to complete in case of error while shutting down alpha. This PR fixes that issue by waiting for the background indexing to complete before we shutdown alpha. The issue can be easily seen by adding a long sleep in the background indexing and trying to shutdown alpha. It can be seen that Alpha doesn't wait for the indexing to complete while shutting down. Fixes #3873
The background reindexing starts indexing in the background but we do not wait for the indexing to complete in case of error while shutting down alpha. This PR fixes that issue by waiting for the background indexing to complete before we shutdown alpha. The issue can be easily seen by adding a long sleep in the background indexing and trying to shutdown alpha. It can be seen that Alpha doesn't wait for the indexing to complete while shutting down. Fixes #3873 (cherry picked from commit dc75424)
The background reindexing starts indexing in the background but we do not wait for the indexing to complete in case of error while shutting down alpha. This PR fixes that issue by waiting for the background indexing to complete before we shutdown alpha. The issue can be easily seen by adding a long sleep in the background indexing and trying to shutdown alpha. It can be seen that Alpha doesn't wait for the indexing to complete while shutting down. Fixes #3873 (cherry picked from commit dc75424)
The background reindexing starts indexing in the background but we do not wait for the indexing to complete in case of error while shutting down alpha. This PR fixes that issue by waiting for the background indexing to complete before we shutdown alpha. The issue can be easily seen by adding a long sleep in the background indexing and trying to shutdown alpha. It can be seen that Alpha doesn't wait for the indexing to complete while shutting down. Fixes hypermodeinc#3873
What version of Go are you using (
go version
)?v1.1.0-rc1
Does this issue reproduce with the latest master?
Yes
What are the hardware specifications of the machine (RAM, OS, Disk)?
General
What did you do?
I ran 6 node cluster (dgraph), flock, flock client earlyoom.
What did you see instead?
Panic.
The text was updated successfully, but these errors were encountered: