cni icon indicating copy to clipboard operation
cni copied to clipboard

skel support context

Open mars1024 opened this issue 5 years ago • 5 comments

I think skel should support context, because CNI plugin may use invoke functions like DelegateAdd or ExecPluginWithResult, in this situation, CNI plugin should decide the default context and pass it to invoke functions.

ref to https://github.com/containernetworking/plugins/pull/346

mars1024 avatar Jun 29 '19 08:06 mars1024

/assign

mars1024 avatar Jun 29 '19 08:06 mars1024

@bboreham @dcbw @squeed sorry for disturbing, do you have some suggestions?

mars1024 avatar Jul 01 '19 13:07 mars1024

@mars1024 we really think this value should come from the runtime; but in reality what we discussed is somewhat different than this:

libcni should handle timeouts and when the timeout is triggered libcni should SIGTERM all the plugins, wait a short amount of time for plugins to clean up, and then SIGKILL them. This means plugins don't have to implement chained context logic of any kind, but (similar to upstart/systemd/etc) have a chance to clean up lockfiles or other resources before they are done.

dcbw avatar Jul 03 '19 16:07 dcbw

https://github.com/containernetworking/cni/issues/687

dcbw avatar Jul 03 '19 16:07 dcbw

@mars1024 we really think this value should come from the runtime; but in reality what we discussed is somewhat different than this:

libcni should handle timeouts and when the timeout is triggered libcni should SIGTERM all the plugins, wait a short amount of time for plugins to clean up, and then SIGKILL them. This means plugins don't have to implement chained context logic of any kind, but (similar to upstart/systemd/etc) have a chance to clean up lockfiles or other resources before they are done.

Yes, I agree on the "SIGTERM and SIGKILL" way, but this does not mean that plugins has no rely on context, instead, plugins should have a signal handler to receive the signals and a parent context based on the signals. I think these changes should be done in skel.

mars1024 avatar Jul 06 '19 01:07 mars1024