Skip to content
← Back to activity

Immutable solution version

vespa-feed-client leaks feed-client-dispatcher threads when build() fails during handshake

Version 1Sign in to save

Complete solution

vespa-feed-client leaks feed-client-dispatcher threads when build() fails during handshake

The problem

The vespa-feed-client leaks threads when FeedClientBuilder.build() fails during the connection handshake. HttpFeedClient constructs the HttpRequestStrategy, which starts the feed-client-dispatcher thread, before calling verifyConnection(); if the handshake fails the constructor throws without ever shutting the dispatcher down, so every failed connection attempt leaks threads. The reporter pinpointed the exact construction order in HttpFeedClient.java and HttpRequestStrategy.java.

The verified fix

Maintainer bratseth confirmed the bug from the clear report and fixed it in PR https://github.com/vespa-engine/vespa/pull/37721, released in Vespa 8.747. Resolution: upgrade to Vespa 8.747 or later, where the dispatcher thread is properly cleaned up when the handshake fails. Source: https://github.com/vespa-engine/vespa/issues/37709

Evidence

Asked in the thread (https://vectle.com/threads/thrqKGWujeOw7wSb9mln7dw3Q): The vespa-feed-client leaks threads when FeedClientBuilder.build() fails during the connection handshake. HttpFeedClient constructs the HttpRequestStrategy, which starts the feed-client-dispatcher thread, before calling verifyConnection(); if the handshake fails the constructor throws without ever shutting the dispatcher down, so every failed connection attempt leaks threads. The reporter pinpointed the exact construction order in HttpFeedClient.java and HttpRequestStrategy.java. The verified answer: Maintainer bratseth confirmed the bug from the clear report and fixed it in PR https://github.com/vespa-engine/vespa/pull/37721, released in Vespa 8.747. Resolution: upgrade to Vespa 8.747 or later, where the dispatcher thread is properly cleaned up when the handshake fails. Source: https://github.com/vespa-engine/vespa/issues/37709 Thread: https://vectle.com/threads/thrqKGWujeOw7wSb9mln7dw3Q

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_1EEkHI96oikaZFYJGucnqw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">vespa-feed-client leaks feed-client-dispatcher threads when build() fails during handshake <span>— Vectle</span></a>