-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
'StopEtcd()' cleanly? #2920
Comments
We are doing integration tests using embedded etcd, so we are interested in StopEtcd cleanly too. This goal is totally reachable AFAIK. But it is not high priority today. Would appreciate that if you could jump in and help on this one. |
@yichengq in IRC I was told to ask you about this issue. What needs to be done to fix this issue? What files should I start looking at, and what moving parts are missing? |
@iankronquist We have done embedded etcd in integration testing(https://github.com/coreos/etcd/blob/master/integration/cluster_test.go#L799), and it works well in testing. But there is still some resources left open. One example is As @unknownzerx mentioned, there may be other blocked handlers. |
@yichengq @iankronquist |
@unknownzerx @iankronquist Moreover, it may have idle connections maintained by net/http library. |
@unknownzerx I have a patch to help embedding etcd since I am working on this as well. Please have a look here: #5584 @yichengq and others, I have noticed that in my programs embedding etcd, if I start the embedded server, then stop it, and then start it again, I get a Thank you for your consideration! |
This should be covered by |
@gyuho Awesome... However, I don't see any public methods called GracefulStop in that package in git master, I only see: https://github.com/coreos/etcd/blob/master/embed/etcd.go#L264 Am I looking in the wrong place? Thanks! |
This should do it https://github.com/coreos/etcd/blob/master/embed/etcd.go#L228-L287
|
@gyuho Okay... To clarify, what you're saying is that the Secondly should I still use Thanks! PS: Any chance you've got the commit sha1 where this was changed? |
@purpleidea
Yes, it will stop all incoming gRPC requests and gracefully shut down gRPC server. Should be safe to restart. It was added via c407e09#diff-269605d45c104f12cbcdc8fb71434acc. |
Thank you so much for the info!
…On Thu, Oct 5, 2017 at 5:03 PM, Gyu-Ho Lee ***@***.***> wrote:
@purpleidea <https://github.com/purpleidea> embed.*Etcd.Close() should be
enough (which calls embed.Server.Stop(), so no need additional
embed.Server.Stop() call).
shuts down the RPC server so that starting and stopping embed repeatedly
in a single process will now work, correct?
Yes, it will stop all incoming gRPC requests and gracefully shut down gRPC
server. Should be safe to restart.
It was added via c407e09#diff-269605d45c104f12cbcdc8fb71434acc
<c407e09#diff-269605d45c104f12cbcdc8fb71434acc>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2920 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIPs4RWobWhkbtiGT9l22K5UQxxY_lFks5spUQigaJpZM4E5jRC>
.
|
I am trying to embed etcd server in our program, making them live in one process. I would like to
StopEtcd()
cleanly without killing the process. Is it possible?Here is a case
?wait=true
client.go:handleKeyWatch
Pass a
stopped
channel to theselect {...}
inhandleKeyWatch()
could solve the problem. But there seems to be other places where a handler blocks and the connection will not get closed. Could you help to figure them out completely?The text was updated successfully, but these errors were encountered: