Commit 75241fe
authored
fix(core): use unpatched lock from forksafe module (#15151)
## Description
<!-- Provide an overview of the change and motivation for the change -->
From a recent profiling escalation, we've seen a flamegraph where
forksafe lock is calling into patched profiling lock.
<img width="918" height="329" alt=" "
src="https://github.com/user-attachments/assets/3bff0b94-4ad7-49b1-847f-61812e2f43eb"
/>
The library used in above flamegraph is version 3.17.0.
From the leaf frame
1. [_release
(_lock.py:#155)](https://github.com/DataDog/dd-trace-py/blob/7451e8468236787abefb164407a8bd75dd005501/ddtrace/profiling/collector/_lock.py#L155)
2. [\_\_exit__
(_lock.py:L#206)](https://github.com/DataDog/dd-trace-py/blob/7451e8468236787abefb164407a8bd75dd005501/ddtrace/profiling/collector/_lock.py#L206)
3. [start
(service.py:L#57)](https://github.com/DataDog/dd-trace-py/blob/7451e8468236787abefb164407a8bd75dd005501/ddtrace/internal/service.py#L57)
https://github.com/DataDog/dd-trace-py/blob/7451e8468236787abefb164407a8bd75dd005501/ddtrace/internal/service.py#L57-L61
`self._service_lock` is declared as a `forksafe.Lock()`
https://github.com/DataDog/dd-trace-py/blob/7451e8468236787abefb164407a8bd75dd005501/ddtrace/internal/service.py#L33
## Testing
<!-- Describe your testing strategy or note what tests are included -->
## Risks
<!-- Note any risks associated with this change, or "None" if no risks
-->
## Additional Notes
<!-- Any other information that would be helpful for reviewers -->1 parent 83a032e commit 75241fe
File tree
4 files changed
+49
-8
lines changed- ddtrace/internal
- releasenotes/notes
- tests/internal
4 files changed
+49
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
142 | | - | |
| 142 | + | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
146 | | - | |
| 146 | + | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
207 | 239 | | |
208 | 240 | | |
209 | 241 | | |
| |||
0 commit comments