You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/01/07 03:54:32 UTC

[GitHub] [apisix] azura27 opened a new pull request #3208: fix : restart failed issue

azura27 opened a new pull request #3208:
URL: https://github.com/apache/apisix/pull/3208


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   Issue #3202 
   refer to https://github.com/apache/apisix/pull/2869
   ### Pre-submission checklist:
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added? yes
   * [ ] Have you added corresponding test cases? yes
   * [ ] Have you modified the corresponding document? 
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list] (https://github.com/apache/apisix/tree/master#community) first**
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #3208: fix: restart failed issue

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3208:
URL: https://github.com/apache/apisix/pull/3208#discussion_r553119731



##########
File path: apisix/cli/ops.lua
##########
@@ -382,11 +382,19 @@ local function start(env, ...)
     local pid_path = env.apisix_home .. "/logs/nginx.pid"
     local pid = util.read_file(pid_path)
     if pid then
-        local hd = popen("lsof -p " .. pid)
+        local lsof_cmd = "lsof -p " .. pid
+        local hd = popen(lsof_cmd)
         local res = hd:read("*a")
-        if res and res ~= "" then
-            print("APISIX is running...")
-            return
+        if res then
+            if res == "" then
+                print("nginx.pid exists with no Nginx process, file will be overwritten")
+            else
+                print("APISIX is running...")
+                return nil
+            end
+        else
+            print("failed to read the result of command: " .. lsof_cmd)
+            return nil
         end

Review comment:
       We can put all `return nil` after here?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] azura27 commented on pull request #3208: fix: restart failed issue

Posted by GitBox <gi...@apache.org>.
azura27 commented on pull request #3208:
URL: https://github.com/apache/apisix/pull/3208#issuecomment-768818977


   OK, got it


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on pull request #3208: fix: restart failed issue

Posted by GitBox <gi...@apache.org>.
spacewander commented on pull request #3208:
URL: https://github.com/apache/apisix/pull/3208#issuecomment-755871051


   ```
   Checking apisix/cli/ops.lua                       1 warning
   
       apisix/cli/ops.lua:390:101: line is too long (113 > 100)
   
   Total: 1 warning / 0 errors in 127 files
   Makefile:73: recipe for target 'lint' failed
   make: *** [lint] Error 1
   ```
   Need to fix the lint.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis commented on pull request #3208: fix: restart failed issue

Posted by GitBox <gi...@apache.org>.
membphis commented on pull request #3208:
URL: https://github.com/apache/apisix/pull/3208#issuecomment-757853643


   ping @azura27


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu closed pull request #3208: fix: restart failed issue

Posted by GitBox <gi...@apache.org>.
Yiyiyimu closed pull request #3208:
URL: https://github.com/apache/apisix/pull/3208


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Yiyiyimu commented on pull request #3208: fix: restart failed issue

Posted by GitBox <gi...@apache.org>.
Yiyiyimu commented on pull request #3208:
URL: https://github.com/apache/apisix/pull/3208#issuecomment-768817909


   I think the issue got fixed by #3416. @azura27 plz have a check then we could close this PR


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org