Skip to content

Commit 70949f1

Browse files
authored
feat(grouping): Add python multiprocessing grouping input (#103185)
This adds a new grouping input for our snapshot tests, which includes the hard-coded-value-containing context line generated by the Python multiprocessing module, the one which is causing issues to under-group in our backend project[1]. Having the snapshots already in place will make it easier to see what changes when we fix the grouping algorithm to handle that situation. [1] getsentry/sentry-python#4744
1 parent 799caef commit 70949f1

File tree

7 files changed

+5090
-0
lines changed

7 files changed

+5090
-0
lines changed
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
{
2+
"platform": "python",
3+
"message": "Failed to process pipeline step process_rules",
4+
"exception": {
5+
"values": [
6+
{
7+
"type": "TimeoutError",
8+
"value": "timed out",
9+
"stacktrace": {
10+
"frames": [
11+
{
12+
"function": "<module>",
13+
"module": "__main__",
14+
"filename": "<string>",
15+
"abs_path": "/usr/src/getsentry/<string>",
16+
"context_line": "from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=11, pipe_handle=32)"
17+
},
18+
{
19+
"function": "spawn_main",
20+
"module": "multiprocessing.spawn",
21+
"filename": "multiprocessing/spawn.py",
22+
"abs_path": "/usr/local/lib/python3.13/multiprocessing/spawn.py",
23+
"context_line": "exitcode = _main(fd, parent_sentinel)"
24+
},
25+
{
26+
"function": "_main",
27+
"module": "multiprocessing.spawn",
28+
"filename": "multiprocessing/spawn.py",
29+
"abs_path": "/usr/local/lib/python3.13/multiprocessing/spawn.py",
30+
"context_line": "return self._bootstrap(parent_sentinel)"
31+
},
32+
{
33+
"function": "_bootstrap",
34+
"module": "multiprocessing.process",
35+
"filename": "multiprocessing/process.py",
36+
"abs_path": "/usr/local/lib/python3.13/multiprocessing/process.py",
37+
"context_line": "self.run()"
38+
},
39+
{
40+
"function": "run",
41+
"module": "multiprocessing.process",
42+
"filename": "multiprocessing/process.py",
43+
"abs_path": "/usr/local/lib/python3.13/multiprocessing/process.py",
44+
"context_line": "self._target(*self._args, **self._kwargs)"
45+
},
46+
{
47+
"function": "child_process",
48+
"module": "sentry.taskworker.workerchild",
49+
"filename": "sentry/taskworker/workerchild.py",
50+
"abs_path": "/usr/src/sentry/src/sentry/taskworker/workerchild.py",
51+
"context_line": "run_worker("
52+
},
53+
{
54+
"function": "run_worker",
55+
"module": "sentry.taskworker.workerchild",
56+
"filename": "sentry/taskworker/workerchild.py",
57+
"abs_path": "/usr/src/sentry/src/sentry/taskworker/workerchild.py",
58+
"context_line": "_execute_activation(task_func, inflight.activation)"
59+
},
60+
{
61+
"function": "_execute_activation",
62+
"module": "sentry.taskworker.workerchild",
63+
"filename": "sentry/taskworker/workerchild.py",
64+
"abs_path": "/usr/src/sentry/src/sentry/taskworker/workerchild.py",
65+
"context_line": "task_func(*args, **kwargs)"
66+
},
67+
{
68+
"function": "__call__",
69+
"module": "sentry.taskworker.task",
70+
"filename": "sentry/taskworker/task.py",
71+
"abs_path": "/usr/src/sentry/src/sentry/taskworker/task.py",
72+
"context_line": "return self._func(*args, **kwargs)"
73+
},
74+
{
75+
"function": "post_process_group",
76+
"module": "sentry.tasks.post_process",
77+
"filename": "sentry/tasks/post_process.py",
78+
"abs_path": "/usr/src/sentry/src/sentry/tasks/post_process.py",
79+
"context_line": "run_post_process_job("
80+
},
81+
{
82+
"function": "run_post_process_job",
83+
"module": "sentry.tasks.post_process",
84+
"filename": "sentry/tasks/post_process.py",
85+
"abs_path": "/usr/src/sentry/src/sentry/tasks/post_process.py",
86+
"context_line": "logger.exception("
87+
},
88+
{
89+
"function": "exception",
90+
"module": "logging",
91+
"filename": "__init__.py",
92+
"abs_path": "/usr/local/lib/python3.13/logging/__init__.py",
93+
"context_line": "self.error(msg, *args, exc_info=exc_info, **kwargs)"
94+
},
95+
{
96+
"function": "error",
97+
"module": "logging",
98+
"filename": "__init__.py",
99+
"abs_path": "/usr/local/lib/python3.13/logging/__init__.py",
100+
"context_line": "self._log(ERROR, msg, args, **kwargs)"
101+
},
102+
{
103+
"function": "_log",
104+
"module": "logging",
105+
"filename": "__init__.py",
106+
"abs_path": "/usr/local/lib/python3.13/logging/__init__.py",
107+
"context_line": "self.handle(record)"
108+
},
109+
{
110+
"function": "handle",
111+
"module": "logging",
112+
"filename": "__init__.py",
113+
"abs_path": "/usr/local/lib/python3.13/logging/__init__.py",
114+
"context_line": "self.callHandlers(record)"
115+
},
116+
{
117+
"function": "callHandlers",
118+
"module": "logging",
119+
"filename": "__init__.py",
120+
"abs_path": "/usr/local/lib/python3.13/logging/__init__.py",
121+
"context_line": "hdlr.handle(record)"
122+
},
123+
{
124+
"function": "handle",
125+
"module": "logging",
126+
"filename": "__init__.py",
127+
"abs_path": "/usr/local/lib/python3.13/logging/__init__.py",
128+
"context_line": "self.emit(record)"
129+
},
130+
{
131+
"function": "connect",
132+
"module": "redis.connection",
133+
"filename": "redis/connection.py",
134+
"abs_path": "/.venv/lib/python3.13/site-packages/redis/connection.py",
135+
"context_line": "sock = self._connect()"
136+
},
137+
{
138+
"function": "_connect",
139+
"module": "redis.connection",
140+
"filename": "redis/connection.py",
141+
"abs_path": "/.venv/lib/python3.13/site-packages/redis/connection.py",
142+
"context_line": "raise err"
143+
},
144+
{
145+
"function": "_connect",
146+
"module": "redis.connection",
147+
"filename": "redis/connection.py",
148+
"abs_path": "/.venv/lib/python3.13/site-packages/redis/connection.py",
149+
"context_line": "sock.connect(socket_address)"
150+
}
151+
]
152+
},
153+
"mechanism": {
154+
"type": "logging",
155+
"handled": true
156+
}
157+
}
158+
]
159+
},
160+
"logentry": {
161+
"message": "Failed to process pipeline step %s",
162+
"formatted": "Failed to process pipeline step process_rules",
163+
"params": ["process_rules"]
164+
},
165+
"logger": "sentry.tasks.post_process"
166+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
created: '2025-11-11T21:47:58.392208+00:00'
3+
creator: sentry
4+
source: tests/sentry/grouping/test_grouphash_metadata.py
5+
---
6+
hash_basis: stacktrace
7+
hashing_metadata: {
8+
"num_stacktraces": 1,
9+
"stacktrace_location": "exception",
10+
"stacktrace_type": "system"
11+
}
12+
---
13+
metrics with tags: {
14+
"grouping.grouphashmetadata.event_hash_basis": {
15+
"hash_basis": "stacktrace",
16+
"is_hybrid_fingerprint": "False"
17+
},
18+
"grouping.grouphashmetadata.event_hashing_metadata.stacktrace": {
19+
"chained_exception": "False",
20+
"stacktrace_location": "exception",
21+
"stacktrace_type": "system"
22+
}
23+
}
24+
---
25+
contributing variants:
26+
system*
27+
hash: "ab3e0802023eb2405b7bed0de8eb227d"
28+
contributing component: exception
29+
hint: None
30+
root_component:
31+
system*
32+
exception*
33+
stacktrace*
34+
frame*
35+
module*
36+
"__main__"
37+
function*
38+
"<module>"
39+
context_line*
40+
"from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=11, pipe_handle=32)"
41+
frame*
42+
module*
43+
"multiprocessing.spawn"
44+
function*
45+
"spawn_main"
46+
context_line*
47+
"exitcode = _main(fd, parent_sentinel)"
48+
frame*
49+
module*
50+
"multiprocessing.spawn"
51+
function*
52+
"_main"
53+
context_line*
54+
"return self._bootstrap(parent_sentinel)"
55+
frame*
56+
module*
57+
"multiprocessing.process"
58+
function*
59+
"_bootstrap"
60+
context_line*
61+
"self.run()"
62+
frame*
63+
module*
64+
"multiprocessing.process"
65+
function*
66+
"run"
67+
context_line*
68+
"self._target(*self._args, **self._kwargs)"
69+
frame*
70+
module*
71+
"sentry.taskworker.workerchild"
72+
function*
73+
"child_process"
74+
context_line*
75+
"run_worker("
76+
frame*
77+
module*
78+
"sentry.taskworker.workerchild"
79+
function*
80+
"run_worker"
81+
context_line*
82+
"_execute_activation(task_func, inflight.activation)"
83+
frame*
84+
module*
85+
"sentry.taskworker.workerchild"
86+
function*
87+
"_execute_activation"
88+
context_line*
89+
"task_func(*args, **kwargs)"
90+
frame*
91+
module*
92+
"sentry.taskworker.task"
93+
function*
94+
"__call__"
95+
context_line*
96+
"return self._func(*args, **kwargs)"
97+
frame*
98+
module*
99+
"sentry.tasks.post_process"
100+
function*
101+
"post_process_group"
102+
context_line*
103+
"run_post_process_job("
104+
frame*
105+
module*
106+
"sentry.tasks.post_process"
107+
function*
108+
"run_post_process_job"
109+
context_line*
110+
"logger.exception("
111+
frame*
112+
module*
113+
"logging"
114+
function*
115+
"exception"
116+
context_line*
117+
"self.error(msg, *args, exc_info=exc_info, **kwargs)"
118+
frame*
119+
module*
120+
"logging"
121+
function*
122+
"error"
123+
context_line*
124+
"self._log(ERROR, msg, args, **kwargs)"
125+
frame*
126+
module*
127+
"logging"
128+
function*
129+
"_log"
130+
context_line*
131+
"self.handle(record)"
132+
frame*
133+
module*
134+
"logging"
135+
function*
136+
"handle"
137+
context_line*
138+
"self.callHandlers(record)"
139+
frame*
140+
module*
141+
"logging"
142+
function*
143+
"callHandlers"
144+
context_line*
145+
"hdlr.handle(record)"
146+
frame*
147+
module*
148+
"logging"
149+
function*
150+
"handle"
151+
context_line*
152+
"self.emit(record)"
153+
frame*
154+
module*
155+
"redis.connection"
156+
function*
157+
"connect"
158+
context_line*
159+
"sock = self._connect()"
160+
frame*
161+
module*
162+
"redis.connection"
163+
function*
164+
"_connect"
165+
context_line*
166+
"raise err"
167+
type*
168+
"TimeoutError"

0 commit comments

Comments
 (0)