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

[broker] Fix NPE that occurs in PersistentStickyKeyDispatcherMultipleConsumers when debug log is enabled #9587

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

massakam
Copy link
Contributor

Motivation

#8969 fixed an issue where NPE could occur in PersistentStickyKeyDispatcherMultipleConsumers. However, if the log level is debug, I think NPE will occur in the following part as well:

log.debug("[{}] select consumer {} with messages num {}, read type is {}",
name, consumer.consumerName(), messagesForC, readType);

Modifications

If consumer is null, "null" will be output to the log as the consumer name.

@massakam massakam added type/bug The PR fixed a bug or issue reported a bug area/broker labels Feb 15, 2021
@massakam massakam added this to the 2.8.0 milestone Feb 15, 2021
@massakam massakam self-assigned this Feb 15, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@merlimat merlimat merged commit c54a66f into apache:master Feb 16, 2021
@massakam massakam deleted the fix-npe branch February 17, 2021 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants