-
Notifications
You must be signed in to change notification settings - Fork 134
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 signal ServerUnix #123
Comments
@cpuguy83 ptal |
Are you sure you aren't running the plugin with |
If you want to not panic on a legitimate |
No I do not run it manually using sh. |
@tiolan I'm referring to how it's actually getting execute in the container. |
@cpuguy83 The entrypoint looks like this: It seems not to be running under
I did another test: I run the executable/entrypoint manually like Any other thing that comes to your mind? |
Hey, looking at the documentation, it seems to me that, by default, any SIGINT or SIGTERM received by the program will kill it immediately. That is why deferred methods do not run. This includes for example the removal of the automatically created socket: go-plugins-helpers/sdk/handler.go Line 64 in c9a8a2d
The correct way to handle this would be following this example and calling the go-plugins-helpers/sdk/handler.go Line 33 in c9a8a2d
A user of this library can't do that however since that reference is not available outside. I have rewritten the What do you think? |
Hey @GSeibt , looks very promising. Looking forward to completion of the PR. |
Hey, I am using the following code for my own Docker log-plugin:
It seems, that ServeUnix is the blocking call, as it does not return.
I would expect, that when invoking
docker plugin disable driver:v1
, it returns and one of the linesor
is visible in the stdout of the plugin (meaning in the logs of Dockerd).
Note: I can see other logs from this plugin using
fmt.Println
in Dockerd logs, so logging works.I guess, that ServeUnix does not handle shutdown signals. Do I need to do it manually?
BTW: In the documentation of
server.Serve
, which is called insidesdk.ServeUnix
, they say:So, is the
if err := h.ServeUnix("logdriver", 0); err != nil {
wrong?The text was updated successfully, but these errors were encountered: