update xds-server package in docker
[src/xds/xds-server.git] / lib / xdsserver / apiv1-exec.go
index 57ea1f1..aea34e4 100644 (file)
@@ -261,6 +261,7 @@ func (s *APIService) execCmd(c *gin.Context) {
        execWS.ExitCB = func(e *eows.ExecOverWS, code int, err error) {
                s.Log.Debugf("Command [Cmd ID %s] exited: code %d, error: %v", e.CmdID, code, err)
 
+               defer LockXdsUpdateCounter(s.Context, false)
                // Close client tty
                defer func() {
                        if gdbPty != nil {
@@ -330,8 +331,10 @@ func (s *APIService) execCmd(c *gin.Context) {
        // Start command execution
        s.Log.Infof("Execute [Cmd ID %s]: %v %v", execWS.CmdID, execWS.Cmd, execWS.Args)
 
+       LockXdsUpdateCounter(s.Context, true)
        err = execWS.Start()
        if err != nil {
+               LockXdsUpdateCounter(s.Context, false)
                common.APIError(c, err.Error())
                return
        }