Description
配置如下:
upstream idmservice {
server 10.13.185.250:28342;
upsync consul-dev.2haohr.com:8500/v1/kv/upstreams/idm-service/ upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
upsync_dump_path /etc/nginx/upstreams/dump/idmservice.conf;
include /etc/nginx/upstreams/dump/idmservice.conf;
}
执行nginx -s reload过程中出现文件写入竞争问题
堆栈如下:
#0 0x00000000004234a7 in ngx_write_fd (n=74, buf=0x7ffc56c75d50, fd=<error reading variable: Cannot access memory at address 0x10>) at src/os/unix/ngx_files.h:147
#1 ngx_log_error_core (level=8, log=0x1776fd0, err=, fmt=) at src/core/ngx_log.c:195
#2 0x000000000055202e in ngx_event_del_timer (ev=) at src/event/ngx_event_timer.h:45
#3 ngx_http_upsync_clear_all_events (cycle=0x7ffc56c75d99) at /home/yuanqing/openresty/openresty-1.15.8.2/bundle/nginx-upsync-module/src/ngx_http_upsync_module.c:3617
#4 0x00000000005521a4 in ngx_http_upsync_need_exit () at /home/yuanqing/openresty/openresty-1.15.8.2/bundle/nginx-upsync-module/src/ngx_http_upsync_module.c:3562
#5 0x00000000005547b8 in ngx_http_upsync_recv_handler (event=0x1763230) at /home/yuanqing/openresty/openresty-1.15.8.2/bundle/nginx-upsync-module/src/ngx_http_upsync_module.c:2777
#6 0x00000000004337d5 in ngx_close_idle_connections (cycle=cycle@entry=0x178cac0) at src/core/ngx_connection.c:1333
#7 0x000000000044b593 in ngx_worker_process_cycle (cycle=cycle@entry=0x178cac0, data=data@entry=0x0) at src/os/unix/ngx_process_cycle.c:833
#8 0x0000000000449e08 in ngx_spawn_process (cycle=cycle@entry=0x178cac0, proc=proc@entry=0x44b480 <ngx_worker_process_cycle>, data=data@entry=0x0, name=name@entry=0x560cbd "worker process",
respawn=respawn@entry=-4) at src/os/unix/ngx_process.c:199
#9 0x000000000044b844 in ngx_start_worker_processes (cycle=0x178cac0, n=1, type=-4) at src/os/unix/ngx_process_cycle.c:397
#10 0x000000000044c834 in ngx_master_process_cycle (cycle=0x178cac0) at src/os/unix/ngx_process_cycle.c:251
#11 0x0000000000421969 in main (argc=, argv=) at src/core/nginx.c:382