Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][broker] Avoid logging errors when there is a connection issue during subscription. #23939

Merged

Conversation

RobertIndie
Copy link
Member

Motivation

The broker currently logs an error if there's a temporary connection issue:

[configuration-metadata-store-14-1] ERROR org.apache.pulsar.broker.service.persistent.PersistentTopic - [xxx] Failed to create subscription: xxxx
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.BrokerServiceException: Connection was closed while the opening the cursor 

We can change this to a warning log level. This way, it won't clutter the broker log, and we can still track connection issues.

Modifications

  • Introduce a new Expcetion BrokerServiceException.ConnectionClosedException to track the connection closed error
  • Avoid logging errors when there is a connection issue during subscription.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

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

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

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

If the box was checked, please highlight the changes

  • 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

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@RobertIndie RobertIndie added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages ready-to-test release/3.0.10 release/3.3.5 release/4.0.3 labels Feb 6, 2025
@RobertIndie RobertIndie added this to the 4.1.0 milestone Feb 6, 2025
@RobertIndie RobertIndie self-assigned this Feb 6, 2025
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 6, 2025
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.21%. Comparing base (bbc6224) to head (f544b90).
Report is 884 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #23939      +/-   ##
============================================
+ Coverage     73.57%   74.21%   +0.63%     
+ Complexity    32624    31802     -822     
============================================
  Files          1877     1853      -24     
  Lines        139502   143740    +4238     
  Branches      15299    16336    +1037     
============================================
+ Hits         102638   106675    +4037     
+ Misses        28908    28656     -252     
- Partials       7956     8409     +453     
Flag Coverage Δ
inttests 27.02% <0.00%> (+2.44%) ⬆️
systests 23.20% <0.00%> (-1.13%) ⬇️
unittests 73.73% <100.00%> (+0.88%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../pulsar/broker/service/BrokerServiceException.java 87.17% <100.00%> (+1.21%) ⬆️
...oker/service/nonpersistent/NonPersistentTopic.java 70.44% <ø> (+0.98%) ⬆️
...sar/broker/service/persistent/PersistentTopic.java 79.80% <100.00%> (+1.34%) ⬆️

... and 1031 files with indirect coverage changes

@BewareMyPower BewareMyPower merged commit 5e5d514 into apache:master Feb 6, 2025
55 of 56 checks passed
RobertIndie added a commit that referenced this pull request Feb 7, 2025
…ue during subscription. (#23939)

(cherry picked from commit 5e5d514)
RobertIndie added a commit that referenced this pull request Feb 7, 2025
…ue during subscription. (#23939)

(cherry picked from commit 5e5d514)
RobertIndie added a commit that referenced this pull request Feb 7, 2025
…ue during subscription. (#23939)

(cherry picked from commit 5e5d514)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Feb 10, 2025
hanmz pushed a commit to hanmz/pulsar that referenced this pull request Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-3.0 cherry-picked/branch-3.3 cherry-picked/branch-4.0 doc-not-needed Your PR changes do not impact docs ready-to-test release/3.0.10 release/3.3.5 release/4.0.3 type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants