Pause dbiterator ealier to prevent lock-order-inversion

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1

    Mutex M2 acquired here while holding mutex M1 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 findnodeintree lib/dns/rbtdb.c:2877:2
    #3 findnode lib/dns/rbtdb.c:2941:10
    #4 dns_db_findnode lib/dns/db.c:439:11
    #5 resume_addnsec3chain lib/dns/zone.c:3776:11
    #6 rss_post lib/dns/zone.c:20659:3
    #7 setnsec3param lib/dns/zone.c:20471:3
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 rss_post lib/dns/zone.c:20658:3
    #2 setnsec3param lib/dns/zone.c:20471:3
    #3 dispatch lib/isc/task.c:1152:7
    #4 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8666:5
    #2 zone_maintenance lib/dns/zone.c:11063:4
    #3 zone_timer lib/dns/zone.c:14098:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 run lib/isc/task.c:1344:2

    Mutex M2 previously acquired by the same thread here:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 resume_iteration lib/dns/rbtdb.c:9357:2
    #3 dbiterator_next lib/dns/rbtdb.c:9647:3
    #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
    #5 zone_nsec3chain lib/dns/zone.c:8656:13
    #6 zone_maintenance lib/dns/zone.c:11063:4
    #7 zone_timer lib/dns/zone.c:14098:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

(cherry picked from commit 9e584a45)
81 jobs for !4137 with 2123-lock-order-inversions-in-main-v9_11 in 30 minutes and 8 seconds (queued for 27 seconds)
latest detached
Status Job ID Name Coverage
  Precheck
passed #1162139
amd64 linux
autoreconf

00:00:21

passed #1162141
amd64 linux
clang-format

00:00:12

passed #1162142
amd64 linux
coccinelle

00:01:08

passed #1162219
linux amd64
danger

00:00:12

passed #1162140
amd64 linux
misc

00:00:20

failed #1162143
amd64 linux
danger

00:00:19

 
  Build
passed #1162158
amd64 linux
clang:asan

00:04:27

passed #1162162
amd64 linux
clang:buster:amd64

00:02:04

passed #1162164
amd64 libvirt
clang:freebsd11:amd64

00:01:58

passed #1162165
amd64 libvirt
clang:freebsd12:amd64

00:01:44

passed #1162166
amd64 libvirt
clang:openbsd:amd64

00:04:21

passed #1162160
amd64 linux
clang:tsan

00:02:30

passed #1162144
amd64 linux
gcc:alpine3.12:amd64

00:01:48

passed #1162157
amd64 linux
gcc:asan

00:03:29

passed #1162149
amd64 linux
gcc:buster:amd64

00:02:05

passed #1162145
amd64 linux
gcc:centos6:amd64

00:01:40

passed #1162146
amd64 linux
gcc:centos7:amd64

00:01:39

passed #1162147
amd64 linux
gcc:centos8:amd64

00:01:36

passed #1162154
amd64 linux
gcc:fedora32:amd64

00:01:47

passed #1162156
amd64 linux
gcc:focal:amd64

00:01:40

passed #1162161
amd64 linux
gcc:mutexatomics

00:01:47

passed #1162151
amd64 linux
gcc:out-of-tree

00:01:46

passed #1162163
amd64 linux
gcc:pkcs11

00:01:46

passed #1162150
amd64 linux
gcc:sid:amd64

00:02:24

passed #1162152
i386 linux
gcc:sid:i386

00:01:43

passed #1162148
amd64 linux
gcc:stretch:amd64

00:01:57

passed #1162159
amd64 linux
gcc:tsan

00:02:07

passed #1162153
amd64 linux
gcc:tumbleweed:amd64

00:01:43

passed #1162155
amd64 linux
gcc:xenial:amd64

00:01:47

passed #1162168
amd64 windows
msvc:windows:amd64

00:00:58

passed #1162167
amd64 linux
nolibtool:sid:amd64

00:02:11

 
  Unit
passed #1162182
amd64 linux
unit:clang:asan

00:01:14

passed #1162186
amd64 linux
unit:clang:buster:amd64

00:00:30

passed #1162188
amd64 libvirt
unit:clang:freebsd11:amd64

00:01:08

passed #1162189
amd64 libvirt
unit:clang:freebsd12:amd64

00:00:54

passed #1162184
amd64 linux
unit:clang:tsan

00:04:01

passed #1162169
amd64 linux
unit:gcc:alpine3.12:amd64

00:00:33

passed #1162181
amd64 linux
unit:gcc:asan

00:01:13

passed #1162174
amd64 linux
unit:gcc:buster:amd64

00:00:31

passed #1162170
amd64 linux
unit:gcc:centos6:amd64

00:00:39

passed #1162171
amd64 linux
unit:gcc:centos7:amd64

00:00:32

passed #1162172
amd64 linux
unit:gcc:centos8:amd64

00:00:30

passed #1162178
amd64 linux
unit:gcc:fedora32:amd64

00:00:31

passed #1162180
amd64 linux
unit:gcc:focal:amd64

00:00:31

passed #1162185
amd64 linux
unit:gcc:mutexatomics

00:00:32

passed #1162187
amd64 linux
unit:gcc:pkcs11

00:00:36

passed #1162175
amd64 linux
unit:gcc:sid:amd64

00:00:32

passed #1162176
i386 linux
unit:gcc:sid:i386

00:00:28

passed #1162173
amd64 linux
unit:gcc:stretch:amd64

00:00:30

passed #1162183
amd64 linux
unit:gcc:tsan

00:05:07

passed #1162177
amd64 linux
unit:gcc:tumbleweed:amd64

00:00:29

passed #1162179
amd64 linux
unit:gcc:xenial:amd64

00:00:32

passed #1162190
amd64 linux
unit:nolibtool:sid:amd64

00:00:44

 
  System
passed #1162204
amd64 linux
system:clang:asan

00:09:29

passed #1162385
linux amd64
system:clang:buster:amd64

00:07:10

passed #1162210
amd64 libvirt
system:clang:freebsd11:amd64

00:08:10

passed #1162211
amd64 libvirt
system:clang:freebsd12:amd64

00:08:19

passed #1162206
amd64 linux
system:clang:tsan

00:11:54

passed #1162191
amd64 linux
system:gcc:alpine3.12:amd64

00:07:23

passed #1162203
amd64 linux
system:gcc:asan

00:09:30

passed #1162196
amd64 linux
system:gcc:buster:amd64

00:07:05

passed #1162192
amd64 linux
system:gcc:centos6:amd64

00:07:16

passed #1162193
amd64 linux
system:gcc:centos7:amd64

00:07:13

passed #1162194
amd64 linux
system:gcc:centos8:amd64

00:07:11

passed #1162200
amd64 linux
system:gcc:fedora32:amd64

00:07:24

passed #1162202
amd64 linux
system:gcc:focal:amd64

00:07:19

passed #1162207
amd64 linux
system:gcc:mutexatomics

00:07:15

passed #1162209
amd64 linux
system:gcc:pkcs11

00:08:26

passed #1162197
amd64 linux
system:gcc:sid:amd64

00:07:04

passed #1162198
i386 linux
system:gcc:sid:i386

00:07:11

passed #1162195
amd64 linux
system:gcc:stretch:amd64

00:07:37

passed #1162205
amd64 linux
system:gcc:tsan

00:13:06

passed #1162199
amd64 linux
system:gcc:tumbleweed:amd64

00:07:10

passed #1162201
amd64 linux
system:gcc:xenial:amd64

00:06:59

passed #1162212
amd64 linux
system:nolibtool:sid:amd64

00:07:22

failed #1162208
amd64 linux
system:clang:buster:amd64

00:07:16

 
  Docs
passed #1162213
amd64 linux
docs

00:00:30

 
  Postcheck
passed #1162217
amd64 linux
cppcheck

00:00:28

passed #1162214
amd64 linux
flake8

00:00:24

passed #1162215
amd64 linux
pylint

00:00:25

passed #1162216
amd64 linux
scan-build

00:10:01