don't detach handle on timeout unless we're still reading

there's a window in which the connect timeout can still run
after a recv completion, in which case we do want to clear the
query but we don't want to perform the extra handle detach.
79 jobs for !4115 with 2140-dig-netmgr in 36 minutes and 8 seconds (queued for 8 seconds)
detached
Status Job ID Name Coverage
  Autoconf
passed #1187730
amd64 linux
autoreconf

00:00:17

 
  Precheck
passed #1187732
amd64 linux
clang-format

00:00:16

passed #1187733
amd64 linux
coccinelle

00:03:36

failed #1187734
amd64 linux
danger

00:00:21

passed #1187731
amd64 linux
misc

00:00:14

passed #1187735
amd64 linux
tarball-create

00:01:40

 
  Build
passed #1187748
amd64 linux
clang:asan

00:02:02

passed #1187752
amd64 linux
clang:buster:amd64

00:01:00

passed #1187755
amd64 libvirt
clang:freebsd11:amd64

00:01:12

passed #1187756
amd64 libvirt
clang:freebsd12:amd64

00:01:21

passed #1187757
amd64 libvirt
clang:openbsd:amd64

00:02:42

passed #1187750
amd64 linux
clang:tsan

00:01:30

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

00:00:54

passed #1187747
amd64 linux
gcc:asan

00:01:50

passed #1187740
amd64 linux
gcc:buster:amd64

00:01:01

passed #1187737
amd64 linux
gcc:centos7:amd64

00:00:49

passed #1187738
amd64 linux
gcc:centos8:amd64

00:00:53

passed #1187746
amd64 linux
gcc:focal:amd64

00:01:06

passed #1187751
amd64 linux
gcc:mutexatomics

00:01:00

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

00:01:08

passed #1187741
amd64 linux
gcc:sid:amd64

00:01:21

passed #1187743
i386 linux
gcc:sid:i386

00:01:07

passed #1187753
amd64 linux
gcc:softhsm2.4

00:00:50

passed #1187754
amd64 linux
gcc:softhsm2.6

00:01:00

passed #1187739
amd64 linux
gcc:stretch:amd64

00:01:01

passed #1187749
amd64 linux
gcc:tsan

00:01:21

passed #1187744
amd64 linux
gcc:tumbleweed:amd64

00:00:57

passed #1187745
amd64 linux
gcc:xenial:amd64

00:01:08

passed #1187758
amd64 windows
msvc:windows:amd64

00:00:45

 
  Unit
passed #1187770
amd64 linux
unit:clang:asan

00:01:16

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

00:01:05

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

00:01:31

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

00:01:34

passed #1187772
amd64 linux
unit:clang:tsan

00:02:57

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

00:01:08

passed #1187769
amd64 linux
unit:gcc:asan

00:01:19

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

00:00:58

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

00:00:59

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

00:01:02

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

00:00:59

passed #1187773
amd64 linux
unit:gcc:mutexatomics

00:01:05

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

00:00:58

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

00:01:02

passed #1187775
amd64 linux
unit:gcc:softhsm2.4

00:00:59

passed #1187776
amd64 linux
unit:gcc:softhsm2.6

00:01:01

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

00:00:57

passed #1187771
amd64 linux
unit:gcc:tsan

00:04:00

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

00:00:57

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

00:01:06

 
  System
passed #1187790
amd64 linux
system:clang:asan

00:11:46

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

00:10:39

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

00:10:10

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

00:09:48

failed #1187792
amd64 linux allowed to fail
system:clang:tsan

00:13:37

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

00:11:52

passed #1187789
amd64 linux
system:gcc:asan

00:11:58

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

00:10:37

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

00:11:30

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

00:11:07

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

00:11:07

passed #1187793
amd64 linux
system:gcc:mutexatomics

00:11:21

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

00:09:31

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

00:10:56

passed #1187806
linux amd64
system:gcc:softhsm2.4

00:09:57

passed #1187796
amd64 linux
system:gcc:softhsm2.6

00:10:49

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

00:11:08

failed #1187791
amd64 linux allowed to fail
system:gcc:tsan

00:13:44

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

00:10:05

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

00:09:55

failed #1187808
amd64 libvirt
system:clang:freebsd12:amd64

01:00:00

failed #1187805
libvirt amd64
system:clang:freebsd12:amd64

00:10:30

failed #1187798
amd64 libvirt
system:clang:freebsd12:amd64

00:10:21

canceled #1187784
amd64 linux
system:gcc:sid:amd64

00:42:15

failed #1187795
amd64 linux
system:gcc:softhsm2.4

00:11:23

 
  Docs
passed #1187799
amd64 linux
docs

00:00:35

 
  Postcheck
passed #1187803
amd64 linux
cppcheck

00:00:46

passed #1187800
amd64 linux
flake8

00:00:19

passed #1187801
amd64 linux
pylint

00:00:29

passed #1187802
amd64 linux
scan-build

00:04:15

 
Name Stage Failure
failed
system:gcc:tsan System
FAIL resolver (exit status: 1)

$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 2199 files

Uploading artifacts as "archive" to coordinator... ok
id=1187791 responseStatus=201 Created token=9LQENL_g
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
system:clang:tsan System
FAIL rrsetorder (exit status: 1)

$ find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
Uploading artifacts for failed job
Uploading artifacts...
untracked: found 1575 files

Uploading artifacts as "archive" to coordinator... ok
id=1187792 responseStatus=201 Created token=s9VmyLsM
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
danger Precheck
 * branch              main       -> FETCH_HEAD



Failing the build, there are 11 fails.
Feedback: https://gitlab.isc.org/isc-projects/bind9/merge_requests/4115#note_162626

Cleaning up file based variables
ERROR: Job failed: exit code 1