Skip to content

Commit 58bf5fd

Browse files
dd-octo-sts[bot]nubtronavonengel
authored
[Backport 7.72.x] fix: Disable ddtrace Python stack profiling V2 (#42247)
Backport a257bc0 from #42222. ___ ### What does this PR do? This PR disables a a feature in ddtrace that can rarely hang. See incident-43814. This workaround disables wall clock time and cpu time for Python profiling. The full fix will be available in ddtrace 3.17. Once we upgrade to that version, we can disable the workaround. The feature is disabled by setting the DD_PROFILING_STACK_V2_ENABLED environment variable to false on init. ### Motivation Avoid potential hangs when integration profiling is enabled. ### Describe how you validated your changes We&#39;ve been running [DD_PROFILING_STACK_V2_ENABLED=false](DataDog/integrations-core@1af8dc3) in the integrations-core CI for a week without hangs. Also, ran a Python custom check that verifies the value of DD_PROFILING_STACK_V2_ENABLED. The custom check ran on a container built by this PR&#39;s pipeline. ### Additional Notes Co-authored-by: nubtron <enrico.donnici@datadoghq.com> Co-authored-by: axel.vonengel <axel.vonengel@datadoghq.com>
1 parent c7b1630 commit 58bf5fd

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

pkg/collector/python/init.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ func init() {
235235
// Setting environment variables must happen as early as possible in the process lifetime to avoid data race with
236236
// `getenv`. Ideally before we start any goroutines that call native code or open network connections.
237237
initFIPS()
238+
239+
// Workaround for a hang issue in ddtrace's stack profiling v2 feature (incident-43814).
240+
// The workaround disables the code path in ddtrace that can cause hangs.
241+
// See: https://ddtrace.readthedocs.io/en/stable/configuration.html#DD_PROFILING_STACK_V2_ENABLED
242+
os.Setenv("DD_PROFILING_STACK_V2_ENABLED", "false")
238243
}
239244

240245
func expvarPythonInitErrors() interface{} {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Each section from every releasenote are combined when the
2+
# CHANGELOG.rst is rendered. So the text needs to be worded so that
3+
# it does not depend on any information only available in another
4+
# section. This may mean repeating some details, but each section
5+
# must be readable independently of the other.
6+
#
7+
# Each section note must be formatted as reStructuredText.
8+
---
9+
other:
10+
- |
11+
CPU and wall clock time collection in Python profiling is temporarily disabled to maintain compatibility with Python 3.13.

0 commit comments

Comments
 (0)