Skip to content

Conversation

@RobertIndie
Copy link
Member

@RobertIndie RobertIndie commented Dec 8, 2025

Motivation

During producer reconnection, retryable errors are currently logged at the error level. These cases are expected and should not be treated as hard failures. They should be logged at the warning level instead.

Modifications

  • Change producer reconnect error logs from error to warning level

Preview

time="2025-12-08T16:52:35+08:00" level=warning msg="Failed to reconnect to broker, will retry later." error="expected error" producerID=1 producer_name=standalone-425-5 topic="persistent://public/default/my-topic-878937000"

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API: (yes / no)
  • The schema: (yes / no / don't know)
  • The default values of configurations: (yes / no)
  • The wire protocol: (yes / no)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@RobertIndie RobertIndie added this to the v0.19.0 milestone Dec 8, 2025
@RobertIndie RobertIndie marked this pull request as ready for review December 8, 2025 14:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR changes the logging level for producer reconnection failures from error to warning for retryable errors. This is appropriate since these failures are expected during normal reconnection attempts and don't represent hard failures.

  • Moved the reconnect failure log from error to warning level
  • Repositioned the log statement to occur after specific error type checks
  • Updated the log message to be more descriptive ("Failed to reconnect to broker, will retry later.")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thomas-bousquet
Copy link
Contributor

thomas-bousquet commented Dec 9, 2025

Thanks for changing the log level, so far we were changing from ERROR to WARN level with the client wrapper we built around the Go Pulsar client.

I believe these 2 messages could probably be changed as well:

  1. Failed to create consumer at reconnect
  2. Failed to create producer at reconnect

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.

2 participants