[#259] innerring: Use blocking pools for audit

Audit task manager should not discard tasks if all workers are
busy, therefore pools should not be non-blocking.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-24 12:47:20 +03:00 committed by Alex Vanin
parent 3ec342b2c3
commit f9e81383ae

View file

@ -207,7 +207,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
server.pubKey = crypto.MarshalPublicKey(&server.key.PublicKey)
auditPool, err := ants.NewPool(cfg.GetInt("audit.task.exec_pool_size"), ants.WithNonblocking(true))
auditPool, err := ants.NewPool(cfg.GetInt("audit.task.exec_pool_size"))
if err != nil {
return nil, err
}
@ -234,7 +234,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
audittask.WithContainerCommunicator(clientCache),
audittask.WithMaxPDPSleepInterval(cfg.GetDuration("audit.pdp.max_sleep_interval")),
audittask.WithPDPWorkerPoolGenerator(func() (util2.WorkerPool, error) {
return ants.NewPool(pdpPoolSize, ants.WithNonblocking(true))
return ants.NewPool(pdpPoolSize)
}),
)