From f9e81383ae5f0a198c7437ba2188b1ca5dbccffb Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 24 Dec 2020 12:47:20 +0300 Subject: [PATCH] [#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 --- pkg/innerring/innerring.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 346f1b78..6a287062 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -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) }), )