Skip to content

Commit ec6811d

Browse files
fix(asm): fix cpu leak (#8629) [APMS-11823] [backport 1.20] (#8921)
This PR fixes a cpu leak in ASM instrumentation, that would add additional overhead to all requests if ASM, API Security and Telemetry were enabled on Flask instrumentation. Related to incident 25768. - [x] e Co-authored-by: Christophe Papazian <[email protected]>
1 parent 2701dc6 commit ec6811d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ddtrace/appsec/_asm_request_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def finalise(self):
127127
env = self.execution_context.get_item("asm_env")
128128
callbacks = GLOBAL_CALLBACKS.get(_CONTEXT_CALL, [])
129129
if env is not None and env.callbacks is not None and env.callbacks.get(_CONTEXT_CALL):
130-
callbacks += env.callbacks.get(_CONTEXT_CALL)
130+
callbacks = callbacks + env.callbacks.get(_CONTEXT_CALL)
131131
if callbacks:
132132
if env is not None:
133133
for function in callbacks:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
ASM: This fix resolves an issue with Flask instrumentation causing CPU leak with ASM,
5+
API Security and Telemetry enabled.

0 commit comments

Comments
 (0)