monkeyDluffy6017 commented on code in PR #10696:
URL: https://github.com/apache/apisix/pull/10696#discussion_r1436017194


##########
apisix/cli/ops.lua:
##########
@@ -916,10 +916,15 @@ local function stop(env)
 end
 
 
+local function sleep(n)
+  execute("sleep " .. tonumber(n))
+end
+
 local function restart(env)
   -- test configuration
   test(env)
   stop(env)
+  sleep(1)

Review Comment:
   I think just sleeping 1 second is not enough, better adding explicit log 
message, set a maximum waiting time and check the old process status every one 
second
   ```
   --- a/apisix/cli/ops.lua
   +++ b/apisix/cli/ops.lua
   @@ -805,8 +805,8 @@ local function start(env, ...)
    
            local ok, err, err_no = signal.kill(pid, signone)
            if ok then
   -            print("APISIX is running...")
   +            print("the old process is still running, the new one won't be 
started!")
                  return
            -- no such process
            elseif err_no ~= errno.ESRCH then
                print(err)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to