Skip to content

Conversation

@3pacccccc
Copy link
Contributor

Motivation

Currently, when setting a clock for the Pulsar client, there is no null check for the clock parameter. This can cause a NullPointerException when sending messages if a null clock is passed.1

Modifications

This PR adds a null check for the clock parameter to provide a clear error message and prevent NPEs.

Verifying this change

  • Make sure that the change passes the CI checks.

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

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Oct 14, 2025
@3pacccccc
Copy link
Contributor Author

BTW, For custom clock implementations, if the millis() method returns abnormal data (such as negative numbers(eg. -1), extremely large values(eg. 9999999999)) or throws exceptions directly, these cases are not validated. Such validations should be considered? any suggestions?

@Technoboy- Technoboy- closed this Oct 27, 2025
@Technoboy- Technoboy- reopened this Oct 27, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.02%. Comparing base (461ffd8) to head (751a34f).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24848      +/-   ##
============================================
- Coverage     74.36%   74.02%   -0.34%     
+ Complexity    33856    32641    -1215     
============================================
  Files          1913     1913              
  Lines        149280   152228    +2948     
  Branches      17324    18163     +839     
============================================
+ Hits         111012   112690    +1678     
- Misses        29445    30515    +1070     
- Partials       8823     9023     +200     
Flag Coverage Δ
inttests 27.27% <0.00%> (+0.62%) ⬆️
systests 23.24% <0.00%> (+0.38%) ⬆️
unittests 73.41% <100.00%> (-0.48%) ⬇️

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

Files with missing lines Coverage Δ
...g/apache/pulsar/client/impl/ClientBuilderImpl.java 87.02% <100.00%> (+0.07%) ⬆️

... and 92 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.

@Technoboy- Technoboy- merged commit 54db7f2 into apache:master Oct 27, 2025
280 of 294 checks passed
lhotari pushed a commit that referenced this pull request Oct 28, 2025
lhotari pushed a commit that referenced this pull request Oct 28, 2025
lhotari pushed a commit that referenced this pull request Oct 28, 2025
manas-ctds pushed a commit to datastax/pulsar that referenced this pull request Oct 29, 2025
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Oct 29, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Oct 30, 2025
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Oct 30, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Nov 6, 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.

5 participants