go-ethereum/common
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
..
bitutil common/bitutil: deprecate XORBytes in favor of stdlib crypto/subtle #33331 (#1952) 2026-01-26 18:07:20 +05:30
compiler common/compiler: json unmarshalling error checks (#25449) 2024-12-28 09:06:31 +08:00
constants common, params: define cancun block for testnet and print more chain config 2025-04-01 14:41:05 +08:00
countdown fix(common): fix race condition in countdown timer StopTimer method (#2014) 2026-02-10 16:51:42 +05:30
fdlimit common/fdlimit: fix linter warning (#25192) 2024-08-03 08:12:28 +08:00
hexutil common: remove duplicate test cases #32624 (#1556) 2025-09-22 20:43:50 +08:00
lru common/lru: use clear builtin (#29399) 2024-08-26 11:17:23 +08:00
math common/math: fix typo in TestMustParseUint64Panic error message #32648 (#1555) 2025-09-24 07:49:30 +08:00
mclock common, p2p: use AbsTime.Add instead of conversion (#25417) 2024-12-28 09:06:31 +08:00
number common: improve documentation comments (#16701) 2024-12-28 09:06:30 +08:00
prque all: use WaigGroup.Go() to simplify code (#1699) 2025-11-29 17:17:08 +05:30
sort common: implement old version of func sort.Slice 2023-10-23 22:51:06 +08:00
big.go core, vm, common: define constantinople fork + shift (#16045) 2018-02-23 12:32:57 +02:00
bytes.go internal: add db operations to api (#24739) 2024-12-28 09:06:30 +08:00
bytes_test.go common: improve test (#20354) 2024-12-28 09:06:30 +08:00
constants.all.go feat(params): start osaka fork #31125 (#2013) 2026-02-06 14:40:58 +05:30
constants.devnet.go feat(params): start osaka fork #31125 (#2013) 2026-02-06 14:40:58 +05:30
constants.go common: not copy constants.go for compatibility 2025-02-23 11:55:20 +08:00
constants.local.go feat(params): start osaka fork #31125 (#2013) 2026-02-06 14:40:58 +05:30
constants.mainnet.go feat(params): start osaka fork #31125 (#2013) 2026-02-06 14:40:58 +05:30
constants.testnet.go feat(params): start osaka fork #31125 (#2013) 2026-02-06 14:40:58 +05:30
debug.go common: rename unused function with typo (#23025) 2024-12-28 09:06:30 +08:00
format.go common: fix duration comparison in PrettyAge #33064 (#1776) 2025-11-15 16:53:17 +05:30
gas.go common: fix gas fee mismatch before TIPTRC21Fee, close XFN-51 (#1636) 2025-11-03 16:24:14 +05:30
path.go common: simplify FileExist helper #32969 (#1871) 2025-12-19 11:07:32 +04:00
size.go common: fix size comparison in StorageSize #33105 (#1772) 2025-11-14 20:08:01 +05:30
size_test.go common: increase StorageSize test coverage (#25188) 2024-12-28 09:06:30 +08:00
test_utils.go PDF-01 (#397) 2024-01-19 15:05:03 +04:00
types.go all: fix goimports warning (#1903) 2026-01-04 17:22:26 +05:30
types_test.go common: remove unused variables (#1875) 2025-12-19 10:39:23 +04:00