feat(internal): thread pool - #1883
Conversation
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1883 +/- ##
==========================================
- Coverage 76.01% 74.31% -1.71%
==========================================
Files 94 104 +10
Lines 22183 25625 +3442
Branches 3937 4622 +685
==========================================
+ Hits 16863 19043 +2180
- Misses 4436 5283 +847
- Partials 884 1299 +415 🚀 New features to boost your workflow:
|
2996a56 to
ec39dc8
Compare
ec39dc8 to
829189b
Compare
829189b to
406b054
Compare
406b054 to
03159d6
Compare
e417bed to
12f4872
Compare
33f0d1a to
d39154d
Compare
d39154d to
9dee343
Compare
265b68d to
8c2f921
Compare
Add a bounded thread pool that runs tasks in parallel and invokes completion callbacks in submission order. Add unit coverage for ordered parallel execution.
143a50b to
6ca0dce
Compare
limbonaut
left a comment
There was a problem hiding this comment.
Epic work!🦸 The chart from the stacked follow-up shows exactly how useful this can be. I really like the idea of a flexible ordered worker queue with pooled threads. Quite a brain-crack to review 😄 I only have one concern, and a naming nit.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e7f44dd. Configure here.
JoshuaMoelans
left a comment
There was a problem hiding this comment.
This is a very cool feature, learned a lot reading up on thread-pooling! LGTM, with just a nit and two questions remaining.
allows capping the total buffer at 1000: https://develop.sentry.dev/sdk/telemetry/logs/#buffering

Introduce a generic thread pool that runs tasks in parallel in a predetermined number of pooled threads and invokes completion callbacks in submission order. The primary use case is the telemetry serialization pool coming in #1946, but it could be used for offloading other heavy tasks, too.
See usage in #1946:
Pool creation:
sentry-native/src/sentry_telemetry.c
Lines 27 to 28 in 1134ee2
Batch submission:
sentry-native/src/sentry_batcher.c
Lines 477 to 478 in 1134ee2
#skip-changelog (internal)