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 2022/08/31 14:18:52 UTC

[GitHub] [apisix] monkeyDluffy6017 commented on a diff in pull request #7826: fix: wait old nginx quit when compress in log roate

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


##########
apisix/plugins/log-rotate.lua:
##########
@@ -169,6 +171,32 @@ local function rename_file(log, date_str)
 end
 
 
+local function wait_old_nginx_exit()
+    local found = true
+    local max_try = 10  -- 10 seconds
+    local prefix = ngx.config.prefix()
+    local file_path = prefix .. "/logs/nginx.pid.oldbin"

Review Comment:
   where or why?
   1. where 
   Before executing the new Nginx binary.
   https://github.com/nginx/nginx/blob/f7ea8c76b55f730daa3b63f5511feb564b44d901/src/core/nginx.c#L717
   2. why
   It's for rollback, if the new Nginx binary doesn't work, we could kill the new one, and use the old Nginx instead.



-- 
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: notifications-unsubscribe@apisix.apache.org

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