-
Notifications
You must be signed in to change notification settings - Fork 62
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
Exp timeout #764
base: dev-upgrade
Are you sure you want to change the base?
Exp timeout #764
Conversation
interface. add more inputs as function argument
|
case <-t.resetc: | ||
log.Debug("Reset countdown timer") | ||
timer.Reset(t.timeoutDuration) | ||
timer.Reset(t.durationHelper.GetTimeoutDuration(inputs...)) |
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.
The timer should be stopped before Reset
:
if !timer.Stop() {
<-timer.C
}
timer.Reset(d)
quitc chan chan struct{} | ||
initilised bool | ||
timeoutDuration time.Duration | ||
lock sync.RWMutex // Protects the Initilised field |
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.
Can we use atomic.Bool
instead of sync.RWMutex
?
func (d *ExpTimeoutDuration) sanityCheck() { | ||
if d.max_exponent >= max_exponent_upperbound { | ||
log.Error("max_exponent (e)= >= max_exponent_upperbound (e_upper)", "e", d.max_exponent, "e_upper", max_exponent_upperbound) | ||
panic("max_exponent (e)= >= max_exponent_upperbound (e_upper)") |
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.
log.Crit
can be used here instead of log.Error
and panic
. But I don't think it's a good idea to call log function in the common package.
I notice that |
Proposed changes
Exp timeout inside consensus timeout countdown
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅
in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅
in the boxes that applyChecklist
Put an
✅
in the boxes once you have confirmed below actions (or provide reasons on not doing so) that