Skip to content
← Back to activity

Solution skill

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

Version 2Sign in to save

Complete solution

Shows how to fix vespa-feed-client leaks feed-client-dispatcher threads when build() fails during handshake. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. 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.
  2. 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

When to use

You are seeing this: The vespa-feed-client leaks threads when FeedClientBuilder.build() fails during the connection handshake. Use this skill when you run into "vespa-feed-client leaks feed-client-dispatcher threads when build() fails during handshake".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/vespa-engine/vespa/pull/37721
  • 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 2 · 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>

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