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

Increase export throughput #2204

Merged
merged 3 commits into from
Mar 24, 2022
Merged

Increase export throughput #2204

merged 3 commits into from
Mar 24, 2022

Conversation

trask
Copy link
Member

@trask trask commented Mar 24, 2022

The first commit is reverting the previous implementation (which was a mess from a diff perspective), so recommend reviewing just the second commit which contains the new implementation, which is much better from a diff perspective, and aligns with the approach we will probably end up with upstream in otel.

@trask trask requested a review from heyams as a code owner March 24, 2022 00:33
@trask trask changed the title Multiple pending exports rewrite Increase export throughput Mar 24, 2022
flushRequested.set(null);
CompletableResultCode.ofAll(pendingExports).join(exporterTimeoutNanos, TimeUnit.NANOSECONDS);
CompletableResultCode flushResult = flushRequested.get();
if (flushResult != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is null check needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I pulled this change in from upstream

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe upstream needs to be updated? based on the old code, null check doesn't seem to be necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

it looks like upstream added the null check to make for nullaway static analysis happy, I'd rather stay in sync with them

pendingExports.remove(result);
});
} else {
result.join(exporterTimeoutNanos, TimeUnit.NANOSECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add log here to warn users that the maxPendingExports is reached here?

pendingExports.add(result);
result.whenComplete(
() -> {
pendingExports.remove(result);
});
} else {
addAsyncExport.recordFailure(
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to track this via statsbeat?
can we add a todo? it's hard to go through the review with the whole team to create a new meter for this in StatsbeatNetwork.. but we can track it through StatsbeatFeature.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't expect this to be common, it allows 100 concurrent exports

@heyams heyams merged commit 0439995 into main Mar 24, 2022
@heyams heyams deleted the pending-exports-rewrite branch March 24, 2022 22:29
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