forked from TrueCloudLab/frostfs-node
[#1653] morph: Handle chain notifications via pool
Handling notification in a synchronous manner may lead to a blocking state if a handler uses neo-go client. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
8f44335925
commit
1c1b5043fc
1 changed files with 6 additions and 1 deletions
|
@ -250,7 +250,12 @@ loop:
|
||||||
continue loop
|
continue loop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err = l.pool.Submit(func() {
|
||||||
l.parseAndHandleNotification(notifyEvent)
|
l.parseAndHandleNotification(notifyEvent)
|
||||||
|
}); err != nil {
|
||||||
|
l.log.Warn("listener worker pool drained",
|
||||||
|
zap.Int("capacity", l.pool.Cap()))
|
||||||
|
}
|
||||||
case notaryEvent, ok := <-notaryChan:
|
case notaryEvent, ok := <-notaryChan:
|
||||||
if !ok {
|
if !ok {
|
||||||
l.log.Warn("stop event listener by notary channel")
|
l.log.Warn("stop event listener by notary channel")
|
||||||
|
|
Loading…
Reference in a new issue