docker-volume-netshare icon indicating copy to clipboard operation
docker-volume-netshare copied to clipboard

unix socket left over after plugin shutdown

Open holgerreif opened this issue 8 years ago • 1 comments

In func listenAndServe() in file vendor/github.com/docker/go-plugins-helpers/sdk/handler.go a unix socket is created via newUnixListener implementented in file vendor/github.com/docker/go-plugins-helpers/sdk/unix_listener.go a unix socket is created for the requested share type (e.g. /run/docker/plugins/cifs.sock).

However with termination of the programm the socket is not removed. This leads to unnecessary timeout because docker engine still asks to the unix socket with no plugin listening.

In vendor/github.com/docker/go-plugins-helpers/sdk/handler.goinstead of return server.Serve(l) the return code of the server should be catched, the socket (either typ tcp or unix) should be removed and then the cathced return code of server should be returned.

I guess, the call defer os.Remove(spec) in handler.goshould actually do this, but then it does not work.

While I'm aware of that the code is taken from repo github.com/docker/go-plugins-helpers w/o any change maybe you could have a look at it.

However, the priority is low, since under normal operations you wouldn't switch between nfs and cifs and back.

holgerreif avatar Apr 09 '16 20:04 holgerreif

Could be the same I encountered during initial setup. I installed the plugin and started the service with default options. Then I changed the settings from -nfs to -cifs including restarting the service. nfs.sock was never removed. I bet due the same reason of not clean up on shutdown.

spali avatar Aug 03 '18 08:08 spali