-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[ISSUE #1692]🍻Implement ChangeInvisibleTimeProcessor#append_check_point method🚀 #1734
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 |
---|---|---|
|
@@ -179,6 +179,7 @@ pub struct BrokerConfig { | |
pub load_balance_poll_name_server_interval: u64, | ||
pub server_load_balancer_enable: bool, | ||
pub enable_remote_escape: bool, | ||
pub enable_pop_log: bool, | ||
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. 🛠️ Refactor suggestion Ensure The new field Apply this diff to include properties.insert(
"forwardTimeout".into(),
self.forward_timeout.to_string().into(),
);
+ properties.insert(
+ "enablePopLog".into(),
+ self.enable_pop_log.to_string().into(),
+ );
}
|
||
} | ||
|
||
impl Default for BrokerConfig { | ||
|
@@ -266,6 +267,7 @@ impl Default for BrokerConfig { | |
load_balance_poll_name_server_interval: 30_000, | ||
server_load_balancer_enable: true, | ||
enable_remote_escape: false, | ||
enable_pop_log: false, | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -98,6 +98,10 @@ | |||||||||||||
} | ||||||||||||||
i32::MAX | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
pub fn get_revive_time(&self) -> i64 { | ||||||||||||||
self.pop_time + self.invisible_time | ||||||||||||||
} | ||||||||||||||
Comment on lines
+102
to
+104
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. Potential integer overflow in Adding Apply this diff to use - pub fn get_revive_time(&self) -> i64 {
- self.pop_time + self.invisible_time
+ pub fn get_revive_time(&self) -> Option<i64> {
+ self.pop_time.checked_add(self.invisible_time)
} Ensure to handle the 📝 Committable suggestion
Suggested change
|
||||||||||||||
} | ||||||||||||||
|
||||||||||||||
impl Ord for PopCheckPoint { | ||||||||||||||
|
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.
Potential overflow when casting
pop_time
fromu64
toi64
Casting
pop_time
fromu64
toi64
may result in an overflow if the value ofpop_time
exceedsi64::MAX
. Consider validatingpop_time
before casting or usingu64
for thepop_time
field inPopCheckPoint
.Apply this diff to change the field type to
u64
: