You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
Since the reclaim logic uses the same context as the delete reconcile logic, extreme concurrency can occur where yurt-iot-dock exits and deletes the device /device profile/ device service in edgex together.
What you expected to happen:
yurt-iot-dock cannot actively delete resources from an existing edgex in the reclaim logic
Anything else we need to know?:
var onlyOneSignalHandler = make(chan struct{})
var shutdownSignals = []os.Signal{syscall.SIGTERM}
func SetupSignalHandler(client client.Client, opts *options.YurtIoTDockOptions) context.Context {
close(onlyOneSignalHandler) // panics when called twice
ctx, cancel := context.WithCancel(context.Background())
setupLog.Info("[SetupSignalHandler] shutdown controller with crd")
c := make(chan os.Signal, 2)
signal.Notify(c, shutdownSignals...)
go func() {
<-c
setupLog.Info("[SetupSignalHandler] shutdown signal concur")
deleteCRsOnControllerShutdown(ctx, client, opts)
cancel()
<-c
os.Exit(1) // second signal. Exit directly.
}()
return ctx
}
Environment:
OpenYurt version: v1.4.0
others
/kind bug
The text was updated successfully, but these errors were encountered:
What happened:
Since the reclaim logic uses the same context as the delete reconcile logic, extreme concurrency can occur where yurt-iot-dock exits and deletes the device /device profile/ device service in edgex together.
What you expected to happen:
yurt-iot-dock cannot actively delete resources from an existing edgex in the reclaim logic
Anything else we need to know?:
Environment:
others
/kind bug
The text was updated successfully, but these errors were encountered: