Skip to content

Possible deadlock in StopPeerForError -> RemovePeer #4591

Closed

Description

@danil-lashin

Tendermint version (use tendermint version or git rev-parse --verify HEAD if installed from source): v0.33.2

ABCI app (name for built-in, URL for self-written if it's publicly available): https://github.com/MinterTeam/minter-go-node

Environment:

  • OS (e.g. from /etc/os-release): Debian GNU/Linux 10 (buster)

What happened: Node cannot be terminated by SIGTERM after some time of operating. Many chan send-ing goroutines found in kill -6 output.

Examples (there are 100+ of them in logs):

goroutine 122508 [chan send, 2320 minutes]:
github.com/tendermint/tendermint/blockchain/v1.(*BlockchainReactor).RemovePeer(0xc03ad5a600, 0x14098c0, 0xc06b9bb5c0, 0xf6dca0, 0xc00007e0f0)
	/go/pkg/mod/github.com/tendermint/[email protected]/blockchain/v1/reactor.go:211 +0xef
goroutine 3759947 [chan send, 2330 minutes]:
github.com/tendermint/tendermint/blockchain/v1.(*BlockchainReactor).RemovePeer(0xc03ad5a600, 0x14098c0, 0xc026134a80, 0xf6dca0, 0xc00007e0f0)
	/go/pkg/mod/github.com/tendermint/[email protected]/blockchain/v1/reactor.go:211 +0xef
github.com/tendermint/tendermint/p2p.(*Switch).stopAndRemovePeer(0xc0002d57a0, 0x14098c0, 0xc026134a80, 0xf6dca0, 0xc00007e0f0)
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/switch.go:356 +0x11c
github.com/tendermint/tendermint/p2p.(*Switch).StopPeerForError(0xc0002d57a0, 0x14098c0, 0xc026134a80, 0xf6dca0, 0xc00007e0f0)
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/switch.go:325 +0x127
github.com/tendermint/tendermint/p2p.createMConnection.func2(0xf6dca0, 0xc00007e0f0)
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/peer.go:390 +0x4e
github.com/tendermint/tendermint/p2p/conn.(*MConnection).stopForError(0xc05aad5600, 0xf6dca0, 0xc00007e0f0)
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/conn/connection.go:341 +0x76
github.com/tendermint/tendermint/p2p/conn.(*MConnection).recvRoutine(0xc05aad5600)
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/conn/connection.go:596 +0xd2d
created by github.com/tendermint/tendermint/p2p/conn.(*MConnection).OnStart
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/conn/connection.go:230 +0x1d9

TrapSignal routine is also asleep:

goroutine 743 [chan send]:
github.com/tendermint/tendermint/blockchain/v1.(*BlockchainReactor).RemovePeer(0xc03ad5a600, 0x14098c0, 0xc05aac0f00, 0x0, 0x0)
	/go/pkg/mod/github.com/tendermint/[email protected]/blockchain/v1/reactor.go:211 +0xef
github.com/tendermint/tendermint/p2p.(*Switch).stopAndRemovePeer(0xc0002d57a0, 0x14098c0, 0xc05aac0f00, 0x0, 0x0)
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/switch.go:356 +0x11c
github.com/tendermint/tendermint/p2p.(*Switch).OnStop(0xc0002d57a0)
	/go/pkg/mod/github.com/tendermint/[email protected]/p2p/switch.go:243 +0x9f
github.com/tendermint/tendermint/libs/service.(*BaseService).Stop(0xc0002d57a0, 0x0, 0x0)
	/go/pkg/mod/github.com/tendermint/[email protected]/libs/service/service.go:167 +0x2f4
github.com/tendermint/tendermint/node.(*Node).OnStop(0xc03aea6000)
	/go/pkg/mod/github.com/tendermint/[email protected]/node/node.go:816 +0xb9
github.com/tendermint/tendermint/libs/service.(*BaseService).Stop(0xc03aea6000, 0x4000, 0xc089b763c0)
	/go/pkg/mod/github.com/tendermint/[email protected]/libs/service/service.go:167 +0x2f4
github.com/MinterTeam/minter-go-node/cmd/minter/cmd.runNode.func4()
	/go/src/github.com/MinterTeam/minter-go-node/cmd/minter/cmd/node.go:109 +0x4c
github.com/tendermint/tendermint/libs/os.TrapSignal.func1(0xc03a5e7080, 0x7f9aa292df60, 0xc039cb94e0, 0xc039cb9500)
	/go/pkg/mod/github.com/tendermint/[email protected]/libs/os/os.go:24 +0x109
created by github.com/tendermint/tendermint/libs/os.TrapSignal
	/go/pkg/mod/github.com/tendermint/[email protected]/libs/os/os.go:20 +0xe6

What you expected to happen: Node should terminate correctly.

Have you tried the latest version: yes

Activity

  1. changed the title [-]Possible StopPeerForError -> RemovePeer deadlock[/-] [+]Possible deadlock in StopPeerForError -> RemovePeer[/+] on Mar 22, 2020
  2. added
    C:sync
    on Mar 23, 2020
  3. melekes commented on Mar 23, 2020

    @melekes
    Contributor

    Refs #4585

  4. added
    T:bug
    on Mar 27, 2020
  5. melekes commented on Apr 13, 2020

    @melekes
    Contributor

    We're going to remove v1 in v0.34 version.

    Have you tried v2 version yet? Have you experienced any troubles with it (or similar issues)?

  6. self-assigned this
    on Nov 24, 2020
  7. melekes commented on Nov 24, 2020

    @melekes
    Contributor

    Judging by the fact that both processBlocksRoutine and poolRoutine goroutines are absent in https://gist.github.com/danil-lashin/3490fbbacdf31217ee718a23b0f5ab48, I suspect blockchain reactor has finished executing, but since we're not removing blockchain reactor, reactor "keeps running" and bcR.errorsForFSMCh eventually gets full.

  8. added a commit that references this issue on Nov 24, 2020
    56013ea
  9. added a commit that references this issue on Dec 1, 2020
    33dbff6
  10. added 2 commits that reference this issue on Dec 1, 2020
    f06feb1
    ebe8251
  11. added a commit that references this issue on Dec 4, 2020
    7ccc6c3
  12. added 4 commits that reference this issue on Dec 10, 2020
    7a71f31
    484bad0
    f5b25e0
    4cc4a88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C:syncT:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions