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

[exporter] moving queue sender from pushing model to pulling model #11414

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sfc-gh-sili
Copy link
Contributor

@sfc-gh-sili sfc-gh-sili commented Oct 10, 2024

Description

This PR implements a new component that pulls from queueSender to solve the issue mentioned in #10368.

The idea is that instead of allocating a group of reading goroutine and block them until the corresponding batch gets flushed, we now use a goroutine to read and then use the same goroutine go flush while allocating new goroutine to read.

Design doc:
https://docs.google.com/document/d/1y5jt7bQ6HWt04MntF8CjUwMBBeNiJs2gV4uUZfJjAsE/edit?usp=sharing

Link to tracking issue

#8122
Fixes #10368

Testing

Documentation

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 96.68874% with 5 lines in your changes missing coverage. Please review.

Project coverage is 92.11%. Comparing base (527df61) to head (d5a1d20).

Files with missing lines Patch % Lines
exporter/internal/queue/batcher.go 96.45% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11414      +/-   ##
==========================================
- Coverage   92.15%   92.11%   -0.05%     
==========================================
  Files         431      432       +1     
  Lines       20238    20382     +144     
==========================================
+ Hits        18650    18774     +124     
- Misses       1227     1240      +13     
- Partials      361      368       +7     

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

@sfc-gh-sili sfc-gh-sili force-pushed the sili-queue-batcher-new branch 10 times, most recently from 220383e to 66f55f2 Compare October 12, 2024 00:56
@sfc-gh-sili sfc-gh-sili changed the title POC Batch sender Oct 12, 2024
@sfc-gh-sili sfc-gh-sili changed the title Batch sender [exporter] moving queue sender from pushing model to pulling model Oct 12, 2024
@sfc-gh-sili sfc-gh-sili marked this pull request as ready for review October 12, 2024 01:41
@sfc-gh-sili sfc-gh-sili requested a review from a team as a code owner October 12, 2024 01:41
bogdandrutu
bogdandrutu previously approved these changes Oct 13, 2024
exporter/exporterhelper/internal/base_exporter.go Outdated Show resolved Hide resolved
be.BatchMergeSplitfunc = bs.mergeSplitFunc

if !be.queueCfg.Enabled {
be.BatchSender = bs
Copy link
Member

Choose a reason for hiding this comment

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

Do you need to create bs at all if not used for !be.queueCfg.Enabled?

Copy link
Contributor Author

@sfc-gh-sili sfc-gh-sili Oct 14, 2024

Choose a reason for hiding this comment

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

This is related to #11414 (comment). The only reason batch sender is initialized here when !be.queueCfg.Enabled is to set up batchMergeFunc.

This can be removed once #11448 is merged.

exporter/internal/queue/batcher.go Show resolved Hide resolved
exporter/internal/queue/batcher.go Show resolved Hide resolved
Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

These are some high-level comments, also if you fix an issue use "Fixes #Number" and github will automatically close the issue.

@bogdandrutu bogdandrutu self-requested a review October 13, 2024 15:18
@bogdandrutu bogdandrutu dismissed their stale review October 13, 2024 15:19

Approved by mistake, PR looks good but needs some more review.

@sfc-gh-sili sfc-gh-sili force-pushed the sili-queue-batcher-new branch 2 times, most recently from 412e1a0 to 963ef11 Compare October 15, 2024 21:25
dmitryax pushed a commit that referenced this pull request Oct 16, 2024
… that operates on batch sender (#11448)

#### Description

As part of the effort to solve
#10368,
we no longer guarantee to initialize a `batchSender` when `batcher` is
enabled. Therefore, we would like to remove the interface to set
`mergeFunc` and `mergeSplitFunc` as a callback that operates on
`batchSender`. Instead, users should use the alternative
`WithBatchFuncs` that is a callback that operates `baseExporter`.

Context:
#11414

#### Link to tracking issue

#8122
#10368

---------

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
@sfc-gh-sili sfc-gh-sili marked this pull request as draft October 17, 2024 21:36
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] Awkwardness due to API between queue sender and batch sender
3 participants