annotate src/os/win32/ngx_dlopen.c @ 8045:aa28c802409f

Resolver: make TCP write timer event cancelable. Similar to 70e65bf8dfd7, the change is made to ensure that the ability to cancel resolver tasks is fully controlled by the caller. As mentioned in the referenced commit, it is safe to make this timer cancelable because resolve tasks can have their own timeouts that are not cancelable. The scenario where this may become a problem is a periodic background resolve task (not tied to a specific request or a client connection), which receives a response with short TTL, large enough to warrant fallback to a TCP query. With each event loop wakeup, we either have a previously set write timer instance or schedule a new one. The non-cancelable write timer can delay or block graceful shutdown of a worker even if the ngx_resolver_ctx_t->cancelable flag is set by the API user, and there are no other tasks or connections. We use the resolver API in this way to maintain the list of upstream server addresses specified with the 'resolve' parameter, and there could be third-party modules implementing similar logic.
author Aleksei Bavshin <a.bavshin@f5.com>
date Wed, 01 Jun 2022 20:17:23 -0700
parents 7142b04337d6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6380
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
1
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
2 /*
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
3 * Copyright (C) Maxim Dounin
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
4 * Copyright (C) Nginx, Inc.
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
5 */
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
6
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
7
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
8 #include <ngx_config.h>
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
9 #include <ngx_core.h>
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
10
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
11
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
12 char *
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
13 ngx_dlerror(void)
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
14 {
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
15 u_char *p;
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
16 static u_char errstr[NGX_MAX_ERROR_STR];
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
17
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
18 p = ngx_strerror(ngx_errno, errstr, NGX_MAX_ERROR_STR);
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
19 *p = '\0';
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
20
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
21 return (char *) errstr;
7142b04337d6 Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
22 }