Skip to content

Conversation

@wmak
Copy link
Member

@wmak wmak commented Dec 8, 2025

  • This adds a timeout to the queries for the trace endpoint so that the entire endpoint doesn't fail if one of the datasets takes too long to execute
  • Had to switch to multiprocessing because ThreadPoolExecutor doesn't have a good way to kill running tasks when they hit timeout? afaict it will wait until all tasks finish before letting you do anything

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 8, 2025
Comment on lines +497 to +502
TRACE_QUERY_TIMEOUT = options.get("performance.traces.endpoint.query-timeout")
results = {}
for future in queries:
label = queries[future]
try:
results[label] = future.get(timeout=TRACE_QUERY_TIMEOUT)

This comment was marked as outdated.

- This adds a timeout to the queries for the trace endpoint so that the
  entire endpoint doesn't fail if one of the datasets takes too long to
  execute
- Had to switch to multiprocessing because threadpool doesn't have a
  good way to kill running tasks when they hit timeout? afaict it will
  wait until all tasks finish before letting you do anything
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/snuba/trace.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           master   #104554       +/-   ##
============================================
+ Coverage   65.78%    80.54%   +14.76%     
============================================
  Files        9338      9346        +8     
  Lines      399925    400312      +387     
  Branches    25621     25621               
============================================
+ Hits       263087    322429    +59342     
+ Misses     136389     77434    -58955     
  Partials      449       449               

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants