Skip to content

[fix][client] Fix HTTP lookup executor leak - #624

Open
cbcbq wants to merge 1 commit into
apache:mainfrom
cbcbq:bugfix/http-lookup-executor-leak
Open

cbcbq wants to merge 1 commit into
apache:mainfrom
cbcbq:bugfix/http-lookup-executor-leak

Conversation

@cbcbq

@cbcbq cbcbq commented Nov 5, 2026 •

Copy link
Copy Markdown

Motivation

With HTTP(S) service URLs, HTTPLookupService owns a private executor that is never closed. Its detached worker retains itself after Client destruction, causing threads to accumulate as Clients are repeatedly created, used and destroyed.

Modifications

Close the executor provider with close(0) in the HTTPLookupService destructor. Nonblocking shutdown avoids waiting for the same worker when a lookup task releases the final service reference.

Verifying this change

  • Make sure that the change passes the CI checks.

Added three regression tests covering:

  • Service destruction from an external thread.
  • Releasing the final service reference on its own worker.
  • Client destruction with and without explicit Client::close().

These tests require no broker and can be selected with --gtest_filter='LookupServiceTest.httpLookup*'.

Documentation

  • doc-not-needed

This change fixes internal executor lifecycle management.

@cbcbq
cbcbq force-pushed the bugfix/http-lookup-executor-leak branch from e3e5ef5 to 3b4de8c Compare November 6, 2026 03:32
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.

1 participant