Skip to content

[exporterhelper] Fix small batch due to scheduling in batch sender #10337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

carsonip
Copy link
Contributor

@carsonip carsonip commented Jun 5, 2024

Description

  • Correctly keep track of bs.activeRequests, which denotes the number of send waiting for next sender in chain to return. This is already done before this PR, but in a way that is vulnerable to unfavorable goroutine scheduling
  • Decrease bs.activeRequests by the number of requests blocked by an activeBatch at once, so that it workarounds the "bug" mentioned in (1).

Link to tracking issue

Fixes #9952

Testing

Added unit test

Documentation

Drop the number of goroutines in batch at once to workaround unfavorable
goroutine scheduling.

Fixes open-telemetry#9952
@carsonip carsonip force-pushed the batchsender-concurrency-tracking branch from b8cc9f8 to 01b07b7 Compare June 5, 2024 20:51
@carsonip
Copy link
Contributor Author

carsonip commented Jun 5, 2024

Blocked by #10315, otherwise test will be flaky.

@carsonip carsonip marked this pull request as ready for review June 5, 2024 21:18
@carsonip carsonip requested review from a team and atoulme June 5, 2024 21:18
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.38%. Comparing base (964e3a9) to head (c456dac).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #10337   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files         387      387           
  Lines       18308    18312    +4     
=======================================
+ Hits        16913    16917    +4     
  Misses       1049     1049           
  Partials      346      346           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@carsonip carsonip requested a review from dmitryax June 7, 2024 08:00
@carsonip carsonip requested a review from dmitryax June 12, 2024 16:31
@dmitryax dmitryax merged commit 4e1c215 into open-telemetry:main Jun 12, 2024
@github-actions github-actions bot added this to the next release milestone Jun 12, 2024
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.

[exporterhelper] Batch sender produces inconsistent and suboptimal batch sizes
2 participants