mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
Table.loop calls (*tableRevalidation).run without holding tab.mutex, while doRefresh -> loadSeedNodes -> handleAddNode reaches the same tableRevalidation state (nodeAdded -> list.push -> list.schedule) in a separate goroutine under tab.mutex. The two paths race on revalidationList.nextTime and list.nodes: the loop goroutine reads nextTime in run, schedules (writes it) and iterates list.nodes via list.get; the refresh goroutine appends to list.nodes and, on the first push, writes nextTime. Acquire tab.mutex for the full duration of run and document that startRequest must be called with the lock held. Remove the now-redundant internal lock/unlock pair in startRequest. Add a regression test that triggers the race deterministically under 'go test -race'. Closes #31460. |
||
|---|---|---|
| .. | ||
| v4wire | ||
| v5wire | ||
| common.go | ||
| lookup.go | ||
| metrics.go | ||
| node.go | ||
| ntp.go | ||
| table.go | ||
| table_reval.go | ||
| table_reval_test.go | ||
| table_test.go | ||
| table_util_test.go | ||
| v4_lookup_test.go | ||
| v4_udp.go | ||
| v4_udp_test.go | ||
| v5_talk.go | ||
| v5_udp.go | ||
| v5_udp_test.go | ||