[VOL-5569]:Reboot handling in go routine
Change-Id: I77e9e96b6d27c6dcf020f2a8da19930e64188995
Signed-off-by: balaji.nagarajan <balaji.nagarajan@radisys.com>
diff --git a/VERSION b/VERSION
index 82a60c0..c6cff55 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.7.20
+3.7.21
diff --git a/rw_core/core/device/agent.go b/rw_core/core/device/agent.go
index 5f0f004..5f0fe51 100755
--- a/rw_core/core/device/agent.go
+++ b/rw_core/core/device/agent.go
@@ -672,14 +672,16 @@
}
subCtx, cancel := context.WithTimeout(coreutils.WithAllMetadataFromContext(ctx), agent.rpcTimeout)
requestStatus.Code = common.OperationResp_OPERATION_IN_PROGRESS
- _, err = client.RebootDevice(subCtx, device)
- if err == nil {
- agent.onSuccess(subCtx, nil, nil, true)
- } else {
- agent.onFailure(subCtx, err, nil, nil, true)
- }
- cancel()
- return err
+ go func() {
+ defer cancel()
+ _, err := client.RebootDevice(subCtx, device)
+ if err == nil {
+ agent.onSuccess(subCtx, nil, nil, true)
+ } else {
+ agent.onFailure(subCtx, err, nil, nil, true)
+ }
+ }()
+ return nil
}
func (agent *Agent) deleteDeviceForce(ctx context.Context) error {