Skip to content

Commit 07952cd

Browse files
aliu39andrewshie-sentry
authored andcommitted
ref(replay-feedback): Use seer default timeout for feedback ingest and replay summaries (#97495)
We should bound the execution time of these Seer requests. The current default timeout of none could hang - see https://requests.readthedocs.io/en/latest/user/advanced/#timeouts. Skipping this for feedback summary endpoints for now. Note for replay summary seer endpoints, both are expected to be fast. POST submits a celery task and GET makes a simple DB query.
1 parent eccda75 commit 07952cd

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/sentry/feedback/usecases/label_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def generate_labels(feedback_message: str, organization_id: int) -> list[str]:
5151
"content-type": "application/json;charset=utf-8",
5252
**sign_with_seer_secret(serialized_request.encode()),
5353
},
54-
timeout=10,
54+
timeout=getattr(settings, "SEER_DEFAULT_TIMEOUT", 5),
5555
)
5656

5757
if response.status_code != 200:

src/sentry/feedback/usecases/title_generation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def make_seer_request(request: GenerateFeedbackTitleRequest) -> bytes:
136136
"content-type": "application/json;charset=utf-8",
137137
**sign_with_seer_secret(serialized_request.encode()),
138138
},
139+
timeout=getattr(settings, "SEER_DEFAULT_TIMEOUT", 5),
139140
)
140141

141142
if response.status_code != 200:

src/sentry/replays/endpoints/project_replay_summary.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def make_seer_request(self, url: str, post_body: dict[str, Any]) -> Response:
9999
"content-type": "application/json;charset=utf-8",
100100
**sign_with_seer_secret(data.encode()),
101101
},
102+
timeout=getattr(settings, "SEER_DEFAULT_TIMEOUT", 5),
102103
)
103104
response.raise_for_status() # Raises HTTPError for 4xx and 5xx.
104105

0 commit comments

Comments
 (0)