monkeyDluffy6017 commented on code in PR #9909: URL: https://github.com/apache/apisix/pull/9909#discussion_r1285961493
########## apisix/core/config_etcd.lua: ########## @@ -257,6 +260,33 @@ local function run_watch(premature) end +local function run_watch(premature) + local run_watch_th = ngx_thread_spawn(do_run_watch, premature) + + ::restart:: + local check_worker_th = ngx_thread_spawn(function () + while not exiting() do + ngx_sleep(0.1) + end + end) + + local ok, err = ngx_thread_wait(check_worker_th) Review Comment: We should handle the situation that the `run_watch_th` thread crashes ########## apisix/core/config_etcd.lua: ########## @@ -257,6 +260,33 @@ local function run_watch(premature) end +local function run_watch(premature) + local run_watch_th = ngx_thread_spawn(do_run_watch, premature) + + ::restart:: + local check_worker_th = ngx_thread_spawn(function () + while not exiting() do + ngx_sleep(0.1) + end + end) + + local ok, err = ngx_thread_wait(check_worker_th) Review Comment: We should handle the case that the `run_watch_th` thread crashes -- 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]
