complain if head change processing is building backlog
This commit is contained in:
parent
3d58ef1c21
commit
e11e0eb32a
@ -290,9 +290,14 @@ func (x *msgIndex) onHeadChange(rev, app []*types.TipSet) error {
|
|||||||
// do it in the background to avoid blocking head change processing
|
// do it in the background to avoid blocking head change processing
|
||||||
x.mx.Lock()
|
x.mx.Lock()
|
||||||
x.pend = append(x.pend, headChange{rev: rev, app: app})
|
x.pend = append(x.pend, headChange{rev: rev, app: app})
|
||||||
// TODO log loudly if this is building backlog (it shouldn't but better be safe on this)
|
pendLen := len(x.pend)
|
||||||
x.mx.Unlock()
|
x.mx.Unlock()
|
||||||
|
|
||||||
|
// complain loudly if this is building backlog
|
||||||
|
if pendLen > 10 {
|
||||||
|
log.Warnf("message index head change processing is building backlog: %d pending head changes", pendLen)
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case x.sema <- struct{}{}:
|
case x.sema <- struct{}{}:
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user