Skip to content
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

Travis failure (internal/log) #20558

Closed
holiman opened this issue Jan 15, 2020 · 1 comment · Fixed by #20569
Closed

Travis failure (internal/log) #20558

holiman opened this issue Jan 15, 2020 · 1 comment · Fixed by #20569

Comments

@holiman
Copy link
Contributor

holiman commented Jan 15, 2020

Happens on travis (spuriously). Example https://travis-ci.org/ethereum/go-ethereum/jobs/636889600#L1085 :

panic: Log in goroutine after TestServerInboundThrottle has completed

goroutine 9726 [running]:
testing.(*common).logDepth(0xc00010e400, 0xc00057e300, 0x60, 0x3)
	/home/travis/.gimme/versions/go1.12.15.linux.amd64/src/testing/testing.go:634 +0x3a6
testing.(*common).log(...)
	/home/travis/.gimme/versions/go1.12.15.linux.amd64/src/testing/testing.go:614
testing.(*common).Logf(0xc00010e400, 0x99a7cf, 0x2, 0xc000067e98, 0x1, 0x1)
	/home/travis/.gimme/versions/go1.12.15.linux.amd64/src/testing/testing.go:649 +0x7f
github.com/ethereum/go-ethereum/internal/testlog.(*logger).flush(0xc0001d2000)
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/internal/testlog/testlog.go:139 +0xfd
github.com/ethereum/go-ethereum/internal/testlog.(*logger).Trace(0xc0001d2000, 0x9aad13, 0x1c, 0xc000555c40, 0x4, 0x4)
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/internal/testlog/testlog.go:80 +0xc7
github.com/ethereum/go-ethereum/p2p.(*Server).SetupConn(0xc00018a280, 0xa5b060, 0xc0002dc4e0, 0x4, 0x0, 0x0, 0x0)
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/p2p/server.go:945 +0x2d8
github.com/ethereum/go-ethereum/p2p.(*Server).listenLoop.func1(0xc00018a280, 0xa5b060, 0xc0002dc4e0, 0xc000100de0)
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/p2p/server.go:915 +0x60
created by github.com/ethereum/go-ethereum/p2p.(*Server).listenLoop
	/home/travis/gopath/src/github.com/ethereum/go-ethereum/p2p/server.go:914 +0x4e7
@holiman
Copy link
Contributor Author

holiman commented Jan 15, 2020

This is due to

go func() {
:

		go func() {
			srv.SetupConn(fd, inboundConn, nil)
			slots <- struct{}{}
		}()

We start a goroutine which does not add to the wg, and thus it can print a log message even after the server has been stopped

holiman added a commit to holiman/go-ethereum that referenced this issue Jan 16, 2020
karalabe pushed a commit that referenced this issue Jan 16, 2020
* p2p: wait for goroutine exit, fixes #20558

* p2p: wait for all slots on exit

Co-authored-by: Martin Holst Swende <martin@swende.se>
enriquefynn pushed a commit to enriquefynn/go-ethereum that referenced this issue Mar 10, 2021
* p2p: wait for goroutine exit, fixes ethereum#20558

* p2p: wait for all slots on exit

Co-authored-by: Martin Holst Swende <martin@swende.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant