Skip to content
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

[chore] Rename disabled queue to waiting queue, implement size limit #12652

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bogdandrutu
Copy link
Member

No need yet for changelog entry because this is not enabled, pending the new queue-batch config.

@bogdandrutu bogdandrutu requested review from a team and dmitryax as code owners March 17, 2025 21:40
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 86.36364% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.61%. Comparing base (f09dad4) to head (5ac90ac).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
exporter/exporterqueue/waiting_queue.go 85.93% 6 Missing and 3 partials ⚠️

❌ Your patch check has failed because the patch coverage (86.36%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12652      +/-   ##
==========================================
- Coverage   91.63%   91.61%   -0.03%     
==========================================
  Files         479      479              
  Lines       26423    26452      +29     
==========================================
+ Hits        24214    24234      +20     
- Misses       1749     1755       +6     
- Partials      460      463       +3     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

If this were only the renaming, I'd agree it's a chore not needing a changelog. But the new condition variable... I would add a changelog about the size limit. If a user is using queue-disabled today, does the condition variable mean slightly more synchronization cost? I'm trying to imagine a user who might like to read that changelog.


func (wq *waitingQueue[T]) Offer(ctx context.Context, el T) error {
elSize := wq.sizer.Sizeof(el)
// Ignore empty requests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Ignore empty requests.
// Ignore empty requests, see https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md#empty-telemetry-envelopes

@bogdandrutu
Copy link
Member Author

If this were only the renaming, I'd agree it's a chore not needing a changelog. But the new condition variable... I would add a changelog about the size limit. If a user is using queue-disabled today, does the condition variable mean slightly more synchronization cost? I'm trying to imagine a user who might like to read that changelog.

Because the "size limit" is max int64, it will never get to the Wait() path, and then it means the Signal path if a if check, see from https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterqueue/cond.go:

// Signal wakes one goroutine waiting on c, if there is any.
// It requires for the caller to hold c.L during the call.
func (c *cond) Signal() {
	if c.waiting == 0 { // Nobody waits ever here.
		return
	}
	c.waiting--
	c.ch <- struct{}{}
}

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