cri,nri: block NRI plugin sync. during event processing.
Block the synchronization of registering NRI plugins during CRI events to avoid the plugin ending up in an inconsistent starting state after initial sync (missing pods, containers or missed events for some pods or containers). Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
This commit is contained in:
@@ -44,6 +44,9 @@ func (c *criService) RemoveContainer(ctx context.Context, r *runtime.RemoveConta
|
||||
log.G(ctx).Tracef("RemoveContainer called for container %q that does not exist", ctrID)
|
||||
return &runtime.RemoveContainerResponse{}, nil
|
||||
}
|
||||
|
||||
defer c.nri.BlockPluginSync().Unblock()
|
||||
|
||||
id := container.ID
|
||||
span.SetAttributes(tracing.Attribute("container.id", id))
|
||||
i, err := container.Container.Info(ctx)
|
||||
|
||||
Reference in New Issue
Block a user