annotate auto/init @ 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 549b13cd793b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
444
42d11f017717 nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents: 297
diff changeset
1
42d11f017717 nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents: 297
diff changeset
2 # Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 2850
diff changeset
3 # Copyright (C) Nginx, Inc.
444
42d11f017717 nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents: 297
diff changeset
4
195
8dee38ea9117 nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
6 NGX_MAKEFILE=$NGX_OBJS/Makefile
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
7 NGX_MODULES_C=$NGX_OBJS/ngx_modules.c
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
8
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
9 NGX_AUTO_HEADERS_H=$NGX_OBJS/ngx_auto_headers.h
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
10 NGX_AUTO_CONFIG_H=$NGX_OBJS/ngx_auto_config.h
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
11
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
12 NGX_AUTOTEST=$NGX_OBJS/autotest
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
13 NGX_AUTOCONF_ERR=$NGX_OBJS/autoconf.err
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
14
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
15 # STUBs
469
2ff194b74f1e nginx-0.1.9-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 455
diff changeset
16 NGX_ERR=$NGX_OBJS/autoconf.err
2ff194b74f1e nginx-0.1.9-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 455
diff changeset
17 MAKEFILE=$NGX_OBJS/Makefile
195
8dee38ea9117 nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
8dee38ea9117 nginx-0.0.1-2003-11-25-23:44:56 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
20 NGX_PCH=
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
21 NGX_USE_PCH=
280
7c7183b3ea8b nginx-0.0.2-2004-03-05-11:34:24 import
Igor Sysoev <igor@sysoev.ru>
parents: 254
diff changeset
22
7c7183b3ea8b nginx-0.0.2-2004-03-05-11:34:24 import
Igor Sysoev <igor@sysoev.ru>
parents: 254
diff changeset
23
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
24 # check the echo's "-n" option and "\c" capability
250
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
25
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
26 if echo "test\c" | grep c >/dev/null; then
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
27
250
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
28 if echo -n test | grep n >/dev/null; then
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
29 ngx_n=
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
30 ngx_c=
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
31
250
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
32 else
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
33 ngx_n=-n
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
34 ngx_c=
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
35 fi
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
36
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
37 else
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
38 ngx_n=
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
39 ngx_c='\c'
1903c6821958 nginx-0.0.2-2004-02-03-23:27:11 import
Igor Sysoev <igor@sysoev.ru>
parents: 210
diff changeset
40 fi
452
23fb87bddda1 nginx-0.1.1-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
41
23fb87bddda1 nginx-0.1.1-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
42
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
43 # create Makefile
452
23fb87bddda1 nginx-0.1.1-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
44
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
45 cat << END > Makefile
452
23fb87bddda1 nginx-0.1.1-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
46
2850
4e05bd832e56 fix "make upgrade" broken in r2759
Igor Sysoev <igor@sysoev.ru>
parents: 1393
diff changeset
47 default: build
452
23fb87bddda1 nginx-0.1.1-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
48
23fb87bddda1 nginx-0.1.1-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
49 clean:
455
295d97d70c69 nginx-0.1.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 452
diff changeset
50 rm -rf Makefile $NGX_OBJS
7778
549b13cd793b Configure: marked top-level make targets as phony.
Ruslan Ermilov <ru@nginx.com>
parents: 6425
diff changeset
51
549b13cd793b Configure: marked top-level make targets as phony.
Ruslan Ermilov <ru@nginx.com>
parents: 6425
diff changeset
52 .PHONY: default clean
452
23fb87bddda1 nginx-0.1.1-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 444
diff changeset
53 END