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

Reduce hot loop in DirectExchangeClient #23320

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

miniway
Copy link
Contributor

@miniway miniway commented Sep 6, 2024

Description

8b6983a has changed improved hot loop on list

On the top of this, we could improve more by keeping running clients. So we don't have to loop through allClients every time.

I faced a case DirectExchangeClient had about 10k allClients. Looping on it every schedule caused lock contention.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( x ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Sep 6, 2024
@wendigo wendigo requested review from dain and sopel39 September 6, 2024 21:21
@@ -389,6 +398,7 @@ private synchronized void clientFinished(HttpPageBufferClient client)
{
requireNonNull(client, "client is null");
if (completedClients.add(client)) {
runningClients.remove(client);
Copy link
Member

Choose a reason for hiding this comment

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

nit: you could add check state that client was actually removed. Similar to adding clients to queuedClients

@sopel39 sopel39 merged commit 56790c7 into trinodb:master Sep 10, 2024
95 checks passed
@github-actions github-actions bot added this to the 458 milestone Sep 10, 2024
@colebow
Copy link
Member

colebow commented Sep 11, 2024

To help with a release note, what is the user-facing impact of this? Improving performance or fixing query failure, and when might it happen? cc @sopel39

@sopel39
Copy link
Member

sopel39 commented Sep 11, 2024

@colebow I would say we probably can skip release note for this one. It's impact is hard to estimate, but requires large scale to see the difference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants