-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Java Client] Avoid IllegalStateException in ClientCnx debug logs #12899
[Java Client] Avoid IllegalStateException in ClientCnx debug logs #12899
Conversation
@eolivelli - PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/pulsarbot run-failure-checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
But I saw that problem without enabling DEBUG logging
/pulsarbot run-failure-checks |
@eolivelli - that is interesting. Based on the stacktrace, line 569 is the debug log line: https://github.com/datastax/pulsar/blob/8ea02d6573c1d5471919b34fc1f115c3b0f34f2e/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java#L569. |
I can add more debug on the debug. I using the standard pulsar-client tool packaged in the docker image, with default configuration files |
Yes, It is likely that |
|
thank you @lhotari ! |
After porting @lhotari change to my local branch I saw the real error thank you @michaeljmarshall and @lhotari
|
Motivation
When running with debug logging, the Java Client can fail when it receives a valid response from the server. The Here is the stack trace. Note that we were running a custom build of the project, so the line numbers do not necessarily line up exactly. The issue is obvious though. If you look at the logic following each of the modified debug logs, you'll notice branching logic based on whether or not some fields are set. This change simply adds guards to ensure that we do not try to get fields that are not set.
Modifications
ClientCnx
class to check if fields are set before calling the associatedget
method for the field.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
This is not a breaking change.
Documentation
no-need-doc