Skip to content

Conversation

@3pacccccc
Copy link
Contributor

Motivation

This PR addresses a potential NullPointerException (NPE) that could occur when calling the seek() method with a TopicMessageIdImpl that has a null topic.

Modifications

  1. Added null check for the owner topic in MultiTopicsConsumerImpl.java before attempting to access it
  2. Added comprehensive test case in SubscriptionSeekTest.java to verify the fix:
    • Creates a partitioned topic
    • Attempts to seek using a TopicMessageIdImpl with null topic
    • Verifies the proper exception is thrown with a clear error message

Verifying this change

  • Make sure that the change passes the CI checks.

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: 3pacccccc#8

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jun 12, 2025
@codelipenghui codelipenghui added this to the 4.1.0 milestone Jun 13, 2025
@codelipenghui codelipenghui added type/bug The PR fixed a bug or issue reported a bug area/client release/4.0.6 labels Jun 13, 2025
Copy link
Member

@nodece nodece left a comment

Choose a reason for hiding this comment

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

LGTM

@3pacccccc 3pacccccc requested a review from nodece June 13, 2025 13:51
@codelipenghui codelipenghui reopened this Jun 16, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.26%. Comparing base (bbc6224) to head (f14c400).
Report is 1153 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24404      +/-   ##
============================================
+ Coverage     73.57%   74.26%   +0.68%     
+ Complexity    32624    32312     -312     
============================================
  Files          1877     1868       -9     
  Lines        139502   145702    +6200     
  Branches      15299    16717    +1418     
============================================
+ Hits         102638   108202    +5564     
- Misses        28908    28915       +7     
- Partials       7956     8585     +629     
Flag Coverage Δ
inttests 27.07% <0.00%> (+2.48%) ⬆️
systests 23.39% <0.00%> (-0.94%) ⬇️
unittests 73.75% <100.00%> (+0.90%) ⬆️

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

Files with missing lines Coverage Δ
...he/pulsar/client/impl/MultiTopicsConsumerImpl.java 78.41% <100.00%> (+0.69%) ⬆️

... and 1085 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codelipenghui codelipenghui merged commit 9337405 into apache:master Jun 17, 2025
197 of 204 checks passed
lhotari pushed a commit that referenced this pull request Jun 19, 2025
lhotari pushed a commit that referenced this pull request Jun 19, 2025
lhotari pushed a commit that referenced this pull request Jun 19, 2025
nodece pushed a commit to nodece/pulsar that referenced this pull request Jun 20, 2025
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 20, 2025
…eId (apache#24404)

(cherry picked from commit 9337405)
(cherry picked from commit c57d2b1)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 21, 2025
…eId (apache#24404)

(cherry picked from commit 9337405)
(cherry picked from commit 23b1f7b)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 24, 2025
…eId (apache#24404)

(cherry picked from commit 9337405)
(cherry picked from commit 23b1f7b)
ganesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 30, 2025
…eId (apache#24404)

(cherry picked from commit 9337405)
(cherry picked from commit c57d2b1)
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jun 30, 2025
…eId (apache#24404)

(cherry picked from commit 9337405)
(cherry picked from commit c57d2b1)
@3pacccccc 3pacccccc deleted the fixNPEWhenSeek branch August 7, 2025 11:19
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants