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

NPE found when timerWheel disabled #6169

Closed
imzs opened this issue Feb 24, 2023 · 3 comments · Fixed by #6184
Closed

NPE found when timerWheel disabled #6169

imzs opened this issue Feb 24, 2023 · 3 comments · Fixed by #6184

Comments

@imzs
Copy link
Contributor

imzs commented Feb 24, 2023

2023-02-24 11:12:10 INFO PopReviveService_0 - reviveQueueId=0, old offset is -1
2023-02-24 11:12:10 INFO PopReviveService_1 - reviveQueueId=1, old offset is -1
2023-02-24 11:12:10 ERROR PopReviveService_2 - reviveQueueId=2, revive error
java.lang.NullPointerException: null
	at org.apache.rocketmq.broker.processor.PopReviveService.consumeReviveMessage(PopReviveService.java:327)
	at org.apache.rocketmq.broker.processor.PopReviveService.run(PopReviveService.java:606)
	at java.lang.Thread.run(Thread.java:766)
2023-02-24 11:12:10 ERROR PopReviveService_6 - reviveQueueId=6, revive error
java.lang.NullPointerException: null
	at org.apache.rocketmq.broker.processor.PopReviveService.consumeReviveMessage(PopReviveService.java:327)
	at org.apache.rocketmq.broker.processor.PopReviveService.run(PopReviveService.java:606)
	at java.lang.Thread.run(Thread.java:766)
2023-02-24 11:12:10 ERROR PopReviveService_4 - reviveQueueId=4, revive error

TimerMessageStore could be null when timerWheelEnable setting false.

Since some processors are related with [timerWheelEnable], such as PopMessageProcessor, AckMessageProcessor, and only initialized once before startup, so can we check this switch and skip instantiation when disabled?

@fuyou001
Copy link
Contributor

fuyou001 commented Feb 24, 2023

The timerWheel-based timer message serves as the foundation of PopMessage so that it is necessary to set timerWheelEnable to true to use PopMessage.

1 similar comment
@drpmma
Copy link
Contributor

drpmma commented Feb 24, 2023

The timerWheel-based timer message serves as the foundation of PopMessage so that it is necessary to set timerWheelEnable to true to use PopMessage.

@drpmma drpmma closed this as completed Feb 24, 2023
@RongtongJin
Copy link
Contributor

Hi @imzs @fuyou001 @drpmma IMO, it is not elegant to keep reporting NPE in the log when the user neither uses pop consume nor timerWheel. Maybe we can optimize it, when users disable timerWheel, they will be forced to not use pop consume and invalid NPE logs will not print.

ShannonDing pushed a commit that referenced this issue Mar 8, 2023
* Fix some NPE when timerWheel disabled

* Add UT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants