Skip to content

[fix][client] Log the exception in ControlledClusterFailover.close#25925

Open
PavelZeger wants to merge 1 commit into
apache:masterfrom
PavelZeger:fix-exception
Open

[fix][client] Log the exception in ControlledClusterFailover.close#25925
PavelZeger wants to merge 1 commit into
apache:masterfrom
PavelZeger:fix-exception

Conversation

@PavelZeger

Copy link
Copy Markdown
Contributor

Fixes #25898

Motivation

When httpClient.close() fails in ControlledClusterFailover.close(), the caught IOException was discarded - only a static "Failed to close http client." line was logged. An operator could not tell whether the failure was a SocketTimeoutException, a connection reset, or an internal error, each of which calls for a different remedy. Since this close() runs when a client transitions away from a cluster, it is often the only signal that the failover completed cleanly, so losing the cause hurts
diagnosability.

Modifications

Attach the caught IOException to the log event via slog's .exception(e), matching the logging pattern already used elsewhere in this class.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

@PavelZeger PavelZeger changed the title [fix][client] Log the underlying exception in ControlledClusterFailover.close [fix][client] Log the exception in ControlledClusterFailover.close Jun 3, 2026
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.

[Bug] ControlledClusterFailover.close loses the underlying exception

1 participant