Commit graph

10 commits

Author SHA1 Message Date
Daniel Liu
81d0db2344
fix(common): fix race condition in countdown timer StopTimer method (#2014)
The TestCountdownShouldBeAbleToStop test was failing intermittently due to
a race condition in the StopTimer() implementation. Previously, the goroutine
used defer to set initilised=false, which executed after close(q) signaled
completion to StopTimer(). This allowed StopTimer() to return before the
state was properly cleaned up, causing isInitilised() checks to occasionally
see stale true values.

Fixed by explicitly calling setInitilised(false) before close(q), ensuring
the state is updated atomically before StopTimer() returns. This eliminates
the race condition and makes the test pass consistently.

Verified by running the test 30 times consecutively with no failures.
2026-02-10 16:51:42 +05:30
Wang Gerui
37b1929621 refactor: more logs on countdown 2025-02-15 17:44:39 +08:00
wgr523
537dc5e6fb
Exp timeout (#764)
* feat: write duration calculation in countdown as
interface. add more inputs as function argument

* feat: ExpTimeoutDuration

* fix: three dots usage

* feat: refine exp duration

* feat: add exp timeout config and use it in countdown

* feat: remove const countdown

* feat: remove use of interface in countdown, use error

* fix: countdown reset timer problem

* fix: add default ExpTimeoutConfig for config
2025-01-19 23:04:03 +08:00
Liam
6ffbd3e141
Xin 259 support multi v2 config (#210)
* update timeout period and waittime

* remove wrong comment

* update config for preparing test
2022-12-06 20:08:56 +08:00
Liam
a3d5d82722
xin-168 node stops because dead lock on timeout events (#73)
* fix race condition issue

* add test to prove
2022-03-25 21:24:35 +11:00
Jerome
d773e15ca8
Xin 137 (#62)
* add GapNumber

* fix broken countdown test

* add gapNumber to existing tests
2022-02-28 18:51:42 +11:00
Jerome
97985fda85
move verify QC into verify header, fix broken tests etc (#61) 2022-02-27 10:25:26 +11:00
Jianrong
521b703207 rename some config variables 2021-12-30 11:00:20 +11:00
Jianrong
bf56a64fe0 make initilised private to countdown 2021-12-30 11:00:20 +11:00
Jianrong
bcb1fea280 add countdown timer 2021-12-30 11:00:20 +11:00