Allow plugins to have multiple handlers#24172
Conversation
|
Though not directly related to the new plugin infra... it would be good if @tiborvass & @anusha-ragunathan can review it as well. |
|
As described in weaveworks/weave#2403 (comment) I have tried this and it seems to resolve the issue originally reported. Thanks! |
pkg/plugins/plugins.go
Outdated
There was a problem hiding this comment.
Is this necessary? (bool defaults to false)
There was a problem hiding this comment.
This is required because we want to make sure p.activated is reset to false if a 2nd handler gets registered later than the first handler gets the activation call.
Once activated, plugin never gives the callback. Hence whenever a new handler is added, we have to reset the flag so that they can receive the callback.
Currently the plugins pkg allows a single handler. This assumption breaks down if there are mutiple listeners to a plugin of a certain Manifest such as NetworkDriver or IpamDriver when swarm-mode is enabled. Signed-off-by: Madhu Venugopal <[email protected]>
|
panic: DockerNetworkSuite.TestDockerNetworkConnectDisconnectToStoppedContainer test timed out after 5m0s This seems to be happening reliably. |
|
Ping @mavenugo! |
|
@anusha-ragunathan @cpuguy83 @icecrime I was thinking about this issue in more detail and I think I will rather fix it in swarmkit to not use the remote-ipam driver. That way it will be consistent with network-driver and hence this issue will not be exposed on the engine side. When swarmkit supports plugin in 1.13, we can have this PR addressed as well. I will pull another PR with just the vendor-in of swarmkit and libnetwork to address this issue. Lets keep this PR open and I will move the release milestone to 1.13 |
|
moby/swarmkit#1130 & moby/libnetwork#1310 should solve #23990 |
|
Closing this PR as the issue was already handled by other fixes. |
Currently the plugins pkg allows a single handler. This assumption breaks down if there are mutiple listeners to a plugin of a certain Manifest such as NetworkDriver or IpamDriver when swarm-mode is enabled.
Fixes #23990
Signed-off-by: Madhu Venugopal [email protected]