forked from TrueCloudLab/frostfs-node
[#195] morph: use blocking unlimited pool for notifications
With non-blocking pool restricted by 10 in capacity, the probability of dropping events is unexpectedly big. Notifications are an essential part of the FrostFS, we should not drop anything, especially new epochs. ``` Mar 31 07:07:03 vedi neofs-ir[19164]: 2023-03-31T07:07:03.901Z debug subscriber/subscriber.go:154 new notification event from sidechain {"name": "NewEpoch"} Mar 31 07:07:03 vedi neofs-ir[19164]: 2023-03-31T07:07:03.901Z warn event/listener.go:248 listener worker pool drained {"chain": "morph", "capacity": 10} ``` Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
ece6c820e7
commit
0948a280fa
3 changed files with 7 additions and 33 deletions
|
@ -181,14 +181,6 @@ func waitNotaryDeposit(ctx context.Context, c *cfg, tx util.Uint256) error {
|
|||
}
|
||||
|
||||
func listenMorphNotifications(ctx context.Context, c *cfg) {
|
||||
// listenerPoolCap is a capacity of a
|
||||
// worker pool inside the listener. It
|
||||
// is used to prevent blocking in neo-go:
|
||||
// the client cannot make RPC requests if
|
||||
// the notification channel is not being
|
||||
// read by another goroutine.
|
||||
const listenerPoolCap = 10
|
||||
|
||||
var (
|
||||
err error
|
||||
subs subscriber.Subscriber
|
||||
|
@ -208,9 +200,8 @@ func listenMorphNotifications(ctx context.Context, c *cfg) {
|
|||
fatalOnErr(err)
|
||||
|
||||
lis, err := event.NewListener(event.ListenerParams{
|
||||
Logger: c.log,
|
||||
Subscriber: subs,
|
||||
WorkerPoolCapacity: listenerPoolCap,
|
||||
Logger: c.log,
|
||||
Subscriber: subs,
|
||||
})
|
||||
fatalOnErr(err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue