Skip to content

nginx will be blocked while calling getaddrinfo #134

Open
@bluestn

Description

@bluestn

如果域名解析比较慢的话,那么在调用getaddrinfo的时候由于执行的是同步操作,导致整个nginx进程卡住。

0 0x00007ffff5d10680 in __poll_nocancel () from /lib64/libc.so.6
#1 0x00007ffff4a97dd4 in __libc_res_nsend () from /lib64/libresolv.so.2
#2 0x00007ffff4a95cce in __libc_res_nquery () from /lib64/libresolv.so.2
#3 0x00007ffff4a968b0 in __libc_res_nsearch () from /lib64/libresolv.so.2
#4 0x00007ffff26c6c53 in _nss_dns_gethostbyname4_r () from /lib64/libnss_dns.so.2
#5 0x00007ffff5d00c08 in gaih_inet () from /lib64/libc.so.6
#6 0x00007ffff5d042cd in getaddrinfo () from /lib64/libc.so.6
#7 0x000000000064441e in ngx_http_upsync_init_server (event=0x7ffff1f8e248) at ../modules/nginx-upsync-module/src/ngx_http_upsync_module.c:3042
#8 0x00000000006430ad in ngx_http_upsync_connect_handler (event=0x7ffff1f8e248) at ../modules/nginx-upsync-module/src/ngx_http_upsync_module.c:2536
#9 0x000000000064307f in ngx_http_upsync_begin_handler (event=0x7ffff1f8e248) at ../modules/nginx-upsync-module/src/ngx_http_upsync_module.c:2519
#10 0x000000000053fcc0 in ngx_event_expire_timers () at src/event/ngx_event_timer.c:94
#11 0x000000000053dd89 in ngx_process_events_and_timers (cycle=0x7ffff3394e10) at src/event/ngx_event.c:256
#12 0x000000000054836a in ngx_single_process_cycle (cycle=0x7ffff3394e10) at src/os/unix/ngx_process_cycle.c:332
#13 0x00000000005126bb in main (argc=1, argv=0x7fffffffe558) at src/core/nginx.c:364

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions