Skip to content

ref(TaskProducer): free up the GIL more - #733

Merged
bmckerry merged 1 commit into
mainfrom
ben/lightweight-taskproducer
Jun 29, 2026
Merged

ref(TaskProducer): free up the GIL more#733
bmckerry merged 1 commit into
mainfrom
ben/lightweight-taskproducer

Conversation

@bmckerry

Copy link
Copy Markdown
Member

When enabling TaskProducer for sentry's track_outcome(), latency until the producer delivery callback was called spiked.
I'm assuming this is because:

  • track_outcome() is higher throughput for producing than anything else I've enabled TaskProducer for
  • the current implementation of TaskProducer/workerchild can hog the GIL

This PR attempts to fix this by:

@bmckerry
bmckerry requested a review from a team as a code owner June 29, 2026 19:53
"processing_pool": processing_pool_name,
},
)
for task in pending_task_futures.copy():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if you want to use concurrent.futures.wait here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at other improvements such as this in a later PR

@bmckerry
bmckerry merged commit 7de0c97 into main Jun 29, 2026
29 checks passed
@bmckerry
bmckerry deleted the ben/lightweight-taskproducer branch June 29, 2026 20:59
bmckerry added a commit to getsentry/sentry that referenced this pull request Jun 30, 2026
getsentry/taskbroker#733 added a configurable
sleep to each iteration of the workerchild future checking thread. This
PR adds that argument to sentry's `run taskworker`.
shayna-ch pushed a commit to getsentry/sentry that referenced this pull request Jun 30, 2026
getsentry/taskbroker#733 added a configurable
sleep to each iteration of the workerchild future checking thread. This
PR adds that argument to sentry's `run taskworker`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants