filecoin-project / filecoin-project/go-jsonrpc

when handleChanOut was exit, it will cause lotus synchronization block

Open
#47 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
100
Forks
95
PR merge metrics
No merged PRs in 30d

Description

https://github.com/filecoin-project/go-jsonrpc/blob/45ea43ac2bec4c1134204bf0bf9ae7b9bc878fb9/websocket.go#L246

lotus.log
```
2021-04-08T03:13:34.867+0800 WARN rpc go-jsonrpc@v0.1.4-0.20210217175800-45ea43ac2bec/websocket.go:246 sendRequest failed: writev tcp4 ip -> ip: writev: broken pipe
2021-04-08T03:13:34.867+0800 WARN rpc go-jsonrpc@v0.1.4-0.20210217175800-45ea43ac2bec/websocket.go:246 sendRequest failed: writev tcp4 ip -> ip: writev: no route to host
2021-04-08T03:13:34.867+0800 WARN rpc go-jsonrpc@v0.1.4-0.20210217175800-45ea43ac2bec/websocket.go:246 sendRequest failed: writev tcp4 ip -> ip: writev: no route to host
2021-04-08T03:13:34.867+0800 WARN chainstore store/store.go:293 head change sub is slow, has 16 buffered entries
2021-04-08T03:13:34.867+0800 WARN chainstore store/store.go:293 head change sub is slow, has 16 buffered entries
2021-04-08T03:13:34.867+0800 WARN chainstore store/store.go:293 head change sub is slow, has 16 buffered entries
2021-04-08T03:13:34.867+0800 WARN chainstore store/store.go:293 head change sub is slow, has 16 buffered entries
2021-04-08T03:13:34.867+0800 WARN chainstore store/store.go:293 head change sub is slow, has 16 buffered entries
```

When miner call lotus `ChainNotify` api, lotus will exec `SubHeadChanges`. But sometime miner was crash, lotus will send request failed, so that `handleOutChans` method was exit and it can not consume 'headchange' topic.
finally lead to `takeHeaviestTipSet` method was block.
```
func (cs *ChainStore) takeHeaviestTipSet(ctx context.Context, ts *types.TipSet) error {
....

if cs.heaviest != nil { // buf
if len(cs.reorgCh) > 0 {
log.Warnf("Reorg channel running behind, %d reorgs buffered", len(cs.reorgCh))
}

// there will block
cs.reorgCh <- reorg{
old: cs.heaviest,
new: ts,
}
} else {
log.Warnf("no heaviest tipset found, using %s", ts.Cids())
}

....
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.