Skip to content

Data race in p2p/discover/table_real.go #31460

@fearlessfe

Description

@fearlessfe

System information

Geth version: latest
OS & Version: OSX

Steps to reproduce the behaviour

When we run our shisui node with -race flag, we found a data race in table(the method name and the line number in the picture is the same with file in geth).

the nextTime field of revalidationList may be read and write in the same time, beacuse these methods run in different goroutines.

type revalidationList struct {
	nodes    []*tableNode
	nextTime mclock.AbsTime
	interval time.Duration
	name     string
}
Image

I'd like to make a pr to fix this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions