Skip to content

Commit 7206434

Browse files
authored
fix(signals): only handle signals if in main thread [backport 1.20] (#7233)
Backport 0e21580 from #7204 to 2.1. Prior to this change ddtrace attempted to register signal handling code regardless of whether or not it was in the main thread. This caused ddtrace to fail and exit because in Python signal handling can only happen in the main thread. After this change, we only add signal handling capabilities if ddtrace is imported/initialized as part of the main thread. ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed. If no release note is required, add label `changelog/no-changelog`. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [ ] Title is accurate. - [ ] No unnecessary changes are introduced. - [ ] Description motivates each change. - [ ] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [ ] Testing strategy adequately addresses listed risk(s). - [ ] Change is maintainable (easy to change, telemetry, documentation). - [ ] Release note makes sense to a user of the library. - [ ] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment. - [ ] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) - [ ] If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from `@DataDog/security-design-and-guidance`. - [ ] This PR doesn't touch any of that.
1 parent d032828 commit 7206434

File tree

16 files changed

+517
-281
lines changed

16 files changed

+517
-281
lines changed

.riot/requirements/1312080.txt

Lines changed: 0 additions & 44 deletions
This file was deleted.

.riot/requirements/144a1a6.txt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --no-annotate .riot/requirements/144a1a6.in
6+
#
7+
atomicwrites==1.4.1
8+
attrs==21.4.0
9+
aws-sam-translator==1.42.0
10+
aws-xray-sdk==2.12.0
11+
backports.functools-lru-cache==1.6.6
12+
backports.ssl-match-hostname==3.7.0.1
13+
backports.tempfile==1.0
14+
backports.weakref==1.0.post1
15+
boto3==1.17.112
16+
boto==2.49.0
17+
botocore==1.20.112
18+
certifi==2021.10.8
19+
cffi==1.15.1
20+
cfn-lint==0.37.1
21+
chardet==4.0.0
22+
configparser==4.0.2
23+
contextlib2==0.6.0.post1
24+
cookies==2.2.1
25+
coverage==5.5
26+
cryptography==3.3.2
27+
decorator==4.4.2
28+
docker==4.4.4
29+
ecdsa==0.14.1
30+
enum34==1.1.10
31+
funcsigs==1.0.2
32+
functools32==3.2.3.post2
33+
future==0.18.3
34+
futures==3.4.0
35+
hypothesis==4.57.1
36+
idna==2.10
37+
importlib-metadata==2.1.3
38+
importlib-resources==1.5.0
39+
ipaddress==1.0.23
40+
jinja2==2.11.3
41+
jmespath==0.10.0
42+
jsondiff==2.0.0
43+
jsonpatch==1.33
44+
jsonpointer==2.4
45+
jsonschema==3.2.0
46+
junit-xml==1.9
47+
markupsafe==1.1.1
48+
mock==3.0.5
49+
more-itertools==5.0.0
50+
moto==1.3.16
51+
networkx==2.2
52+
opentracing==2.4.0
53+
packaging==20.9
54+
pathlib2==2.3.7.post1
55+
pluggy==0.13.1
56+
py==1.11.0
57+
pyasn1==0.5.0
58+
pycparser==2.21
59+
pynamodb==4.3.3
60+
pyparsing==2.4.7
61+
pyrsistent==0.16.0
62+
pytest-cov==2.12.1
63+
pytest-mock==2.0.0
64+
pytest==4.6.11
65+
python-dateutil==2.8.2
66+
python-jose[cryptography]==3.2.0
67+
pytz==2023.3.post1
68+
pyyaml==5.3.1
69+
requests==2.27.1
70+
responses==0.17.0
71+
rsa==4.5
72+
s3transfer==0.4.2
73+
scandir==1.10.0
74+
singledispatch==3.7.0
75+
six==1.16.0
76+
sortedcontainers==2.4.0
77+
sshpubkeys==3.1.0
78+
toml==0.10.2
79+
typing==3.10.0.0
80+
urllib3==1.26.17
81+
wcwidth==0.2.8
82+
websocket-client==0.59.0
83+
werkzeug==1.0.1
84+
wrapt==1.15.0
85+
xmltodict==0.12.0
86+
zipp==1.2.0
87+
88+
# The following packages are considered to be unsafe in a requirements file:
89+
# setuptools

.riot/requirements/15736be.txt

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --no-annotate .riot/requirements/15736be.in
6+
#
7+
attrs==22.1.0
8+
aws-sam-translator==1.42.0
9+
aws-xray-sdk==2.12.0
10+
boto3==1.16.63
11+
boto==2.49.0
12+
botocore==1.19.63
13+
certifi==2021.10.8
14+
cffi==1.15.1
15+
cfn-lint==0.37.1
16+
chardet==4.0.0
17+
coverage==5.5
18+
cryptography==3.2.1
19+
decorator==5.1.1
20+
docker==4.4.4
21+
ecdsa==0.14.1
22+
hypothesis==5.33.2
23+
idna==2.10
24+
importlib-metadata==2.1.3
25+
importlib-resources==1.5.0
26+
iniconfig==1.1.1
27+
jinja2==2.11.3
28+
jmespath==0.10.0
29+
jsondiff==2.0.0
30+
jsonpatch==1.32
31+
jsonpointer==2.3
32+
jsonschema==3.2.0
33+
junit-xml==1.9
34+
markupsafe==1.1.1
35+
mock==3.0.5
36+
more-itertools==8.14.0
37+
moto==1.3.16
38+
networkx==2.4
39+
opentracing==2.4.0
40+
packaging==20.9
41+
pathlib2==2.3.7.post1
42+
pluggy==0.13.1
43+
py==1.11.0
44+
pyasn1==0.4.8
45+
pycparser==2.21
46+
pyparsing==2.4.7
47+
pyrsistent==0.17.3
48+
pytest-cov==2.12.1
49+
pytest-mock==3.5.1
50+
pytest==6.1.2
51+
python-dateutil==2.8.2
52+
python-jose[cryptography]==3.2.0
53+
pytz==2023.3.post1
54+
pyyaml==5.3.1
55+
requests==2.25.1
56+
responses==0.17.0
57+
rsa==4.7
58+
s3transfer==0.3.7
59+
six==1.16.0
60+
sortedcontainers==2.4.0
61+
sshpubkeys==3.3.1
62+
toml==0.10.2
63+
urllib3==1.26.9
64+
websocket-client==0.59.0
65+
werkzeug==1.0.1
66+
wrapt==1.15.0
67+
xmltodict==0.13.0
68+
zipp==1.2.0
69+
70+
# The following packages are considered to be unsafe in a requirements file:
71+
# setuptools

.riot/requirements/1679954.txt

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --no-annotate .riot/requirements/1679954.in
6+
#
7+
atomicwrites==1.4.1
8+
attrs==21.4.0
9+
aws-sam-translator==1.42.0
10+
aws-xray-sdk==2.12.0
11+
backports.functools-lru-cache==1.6.6
12+
backports.ssl-match-hostname==3.7.0.1
13+
backports.tempfile==1.0
14+
backports.weakref==1.0.post1
15+
boto3==1.16.63
16+
boto==2.49.0
17+
botocore==1.19.63
18+
certifi==2021.10.8
19+
cffi==1.15.1
20+
cfn-lint==0.37.1
21+
chardet==4.0.0
22+
configparser==4.0.2
23+
contextlib2==0.6.0.post1
24+
cookies==2.2.1
25+
coverage==5.5
26+
cryptography==3.3.2
27+
decorator==4.4.2
28+
docker==4.4.4
29+
ecdsa==0.14.1
30+
enum34==1.1.10
31+
funcsigs==1.0.2
32+
functools32==3.2.3.post2
33+
future==0.18.3
34+
futures==3.4.0
35+
hypothesis==4.57.1
36+
idna==2.10
37+
importlib-metadata==2.1.3
38+
importlib-resources==1.5.0
39+
ipaddress==1.0.23
40+
jinja2==2.11.3
41+
jmespath==0.10.0
42+
jsondiff==2.0.0
43+
jsonpatch==1.33
44+
jsonpointer==2.4
45+
jsonschema==3.2.0
46+
junit-xml==1.9
47+
markupsafe==1.1.1
48+
mock==3.0.5
49+
more-itertools==5.0.0
50+
moto==1.3.16
51+
networkx==2.2
52+
opentracing==2.4.0
53+
packaging==20.9
54+
pathlib2==2.3.7.post1
55+
pluggy==0.13.1
56+
py==1.11.0
57+
pyasn1==0.5.0
58+
pycparser==2.21
59+
pyparsing==2.4.7
60+
pyrsistent==0.16.0
61+
pytest-cov==2.12.1
62+
pytest-mock==2.0.0
63+
pytest==4.6.11
64+
python-dateutil==2.8.2
65+
python-jose[cryptography]==3.2.0
66+
pytz==2023.3.post1
67+
pyyaml==5.3.1
68+
requests==2.27.1
69+
responses==0.17.0
70+
rsa==4.5
71+
s3transfer==0.3.7
72+
scandir==1.10.0
73+
singledispatch==3.7.0
74+
six==1.16.0
75+
sortedcontainers==2.4.0
76+
sshpubkeys==3.1.0
77+
toml==0.10.2
78+
typing==3.10.0.0
79+
urllib3==1.26.17
80+
wcwidth==0.2.8
81+
websocket-client==0.59.0
82+
werkzeug==1.0.1
83+
wrapt==1.15.0
84+
xmltodict==0.12.0
85+
zipp==1.2.0
86+
87+
# The following packages are considered to be unsafe in a requirements file:
88+
# setuptools

.riot/requirements/16f9188.txt

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)