Skip to content

Commit af91403

Browse files
authored
sample-event: try synchronous kafka producing (#54748)
- when creating a sample event, try producing synchronously, since when done through the sample_event [endpoint](https://github.com/getsentry/sentry/blob/7e204dc42b2dd671aec955f108ea334dea72339e/src/sentry/api/endpoints/project_create_sample.py#L19), we may not finish flushing before the request thread is terminated. - can test this on S4S to see if fixes issue, and quickly revert before it makes it to canary before it can cause problems, but I think it should be fine? Note: my understanding of kafka / how Django uWSGI lifecycles work is not expert, so my analysis/assumptions here may be off.
1 parent 123c836 commit af91403

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Diff for: src/sentry/eventstream/kafka/backend.py

+2
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def insert(
161161
"sample_event": True,
162162
},
163163
)
164+
kwargs["asynchronous"] = False
165+
164166
super().insert(
165167
event,
166168
is_new,

Diff for: src/sentry/eventstream/snuba.py

+1
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def insert(
215215
},
216216
),
217217
headers=headers,
218+
asynchronous=kwargs.get("asynchronous", True),
218219
skip_semantic_partitioning=skip_semantic_partitioning,
219220
event_type=event_type,
220221
)

0 commit comments

Comments
 (0)