-
Notifications
You must be signed in to change notification settings - Fork 233
[ISSUES #6352, #6349 and #6325] #6353
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1755,7 +1755,7 @@ impl<MS: MessageStore> BrokerRuntimeInner<MS> { | |
|
|
||
| #[inline] | ||
| pub fn timer_message_store_unchecked(&self) -> &TimerMessageStore { | ||
| unsafe { self.timer_message_store.as_ref().unwrap_unchecked() } | ||
| unimplemented!("timer_message_store_unchecked is not implemented yet") | ||
| } | ||
|
Comment on lines
1757
to
1759
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for any callers of timer_message_store_unchecked across all Rust files
rg -n 'timer_message_store_unchecked' --type rustRepository: mxsm/rocketmq-rust Length of output: 415 🏁 Script executed: #!/bin/bash
# Get context around the caller at hook_utils.rs:157
sed -n '145,170p' rocketmq-broker/src/util/hook_utils.rs | cat -nRepository: mxsm/rocketmq-rust Length of output: 1568 Do not use
Either implement the method properly or remove the public API. If the feature is not ready, consider returning an error or wrapping the method with a feature flag. 🤖 Prompt for AI Agents |
||
|
|
||
| #[inline] | ||
|
|
||
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.
This change will cause a runtime panic when timer messages are processed. The method
timer_message_store_unchecked()is actively called inrocketmq-broker/src/util/hook_utils.rs:157within thehandle_schedule_messagefunction, which is used byScheduleMessageHookfor processing messages with timer properties. When a timer message is handled (and timer_wheel_enable is true), this will panic instead of returning the timer message store. The original unsafeunwrap_unchecked()should be replaced with a safe alternative likeunwrap()or proper error handling, notunimplemented!().