Skip to content

Conversation

@dlg99
Copy link
Contributor

@dlg99 dlg99 commented Jun 30, 2025

Motivation

Customer got

Got exception java.lang.IllegalStateException: Field 'message' is not set
  at org.apache.pulsar.common.api.proto.CommandLookupTopicResponse.getMessage(CommandLookupTopicResponse.java:220)
  at org.apache.pulsar.client.impl.ClientCnx.handleLookupResponse(ClientCnx.java:629)
  at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:154)
  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
  at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)

in production (Pulsar 3.0.x, not sure about exact "x" right now, the client could be 3.2.x).

I don't know exactly how the message ended up empty but:

  • it is optional in protobuf so such cases should be anticipated
  • in some cases it is set using throwable.getMessage() and who knows if that message was set.

Modifications

added hasMessage() checks.
Passing the ServerError as string for the logging, null otherwise (similar to handlePartitionResponse's approach)

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.

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

NO

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: dlg99#25

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jun 30, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.29%. Comparing base (bbc6224) to head (9d6a4ff).
Report is 1181 commits behind head on master.

Files with missing lines Patch % Lines
.../java/org/apache/pulsar/client/impl/ClientCnx.java 50.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24472      +/-   ##
============================================
+ Coverage     73.57%   74.29%   +0.72%     
- Complexity    32624    32746     +122     
============================================
  Files          1877     1868       -9     
  Lines        139502   145582    +6080     
  Branches      15299    16664    +1365     
============================================
+ Hits         102638   108160    +5522     
+ Misses        28908    28849      -59     
- Partials       7956     8573     +617     
Flag Coverage Δ
inttests 26.65% <50.00%> (+2.07%) ⬆️
systests 23.36% <0.00%> (-0.97%) ⬇️
unittests 73.77% <50.00%> (+0.92%) ⬆️

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

Files with missing lines Coverage Δ
.../java/org/apache/pulsar/client/impl/ClientCnx.java 69.31% <50.00%> (-2.46%) ⬇️

... and 1086 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 45da98d into apache:master Jul 2, 2025
150 of 155 checks passed
@codelipenghui codelipenghui added this to the 4.1.0 milestone Jul 2, 2025
@codelipenghui codelipenghui added type/bug The PR fixed a bug or issue reported a bug release/4.0.6 labels Jul 2, 2025
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 22, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 24, 2025
lhotari pushed a commit that referenced this pull request Jul 25, 2025
lhotari pushed a commit that referenced this pull request Jul 25, 2025
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Jul 28, 2025
priyanshu-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 28, 2025
srinath-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 31, 2025
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