From 10d0cf70ff4aa670c4d95fd8e126a6d9e69ef1ad Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Wed, 27 Nov 2024 12:18:43 +0800 Subject: [PATCH] test --- pkg/kwok/controllers/node_controller.go | 3 +++ pkg/kwok/controllers/node_lease_controller.go | 3 +++ pkg/kwok/controllers/pod_controller.go | 3 +++ pkg/kwok/controllers/stage_controller.go | 3 +++ 4 files changed, 12 insertions(+) diff --git a/pkg/kwok/controllers/node_controller.go b/pkg/kwok/controllers/node_controller.go index ce050621c..df6193fc5 100644 --- a/pkg/kwok/controllers/node_controller.go +++ b/pkg/kwok/controllers/node_controller.go @@ -327,6 +327,9 @@ func (c *NodeController) playStageWorker(ctx context.Context) { if !ok { return } + if c.delayQueue.Len() > 10 { + go c.playStageWorker(ctx) + } c.delayQueueMapping.Delete(node.Key) needRetry, err := c.playStage(ctx, node.Resource, node.Stage) if err != nil { diff --git a/pkg/kwok/controllers/node_lease_controller.go b/pkg/kwok/controllers/node_lease_controller.go index dbf450753..0e2e420ff 100644 --- a/pkg/kwok/controllers/node_lease_controller.go +++ b/pkg/kwok/controllers/node_lease_controller.go @@ -112,6 +112,9 @@ func (c *NodeLeaseController) syncWorker(ctx context.Context) { if !ok { return } + if c.delayQueue.Len() > 10 { + go c.syncWorker(ctx) + } first, ok := c.holdLeaseSet.Load(nodeName) if !ok { continue diff --git a/pkg/kwok/controllers/pod_controller.go b/pkg/kwok/controllers/pod_controller.go index 4c3588d7e..acda850da 100644 --- a/pkg/kwok/controllers/pod_controller.go +++ b/pkg/kwok/controllers/pod_controller.go @@ -262,6 +262,9 @@ func (c *PodController) playStageWorker(ctx context.Context) { if !ok { return } + if c.delayQueue.Len() > 10 { + go c.playStageWorker(ctx) + } c.delayQueueMapping.Delete(pod.Key) needRetry, err := c.playStage(ctx, pod.Resource, pod.Stage) if err != nil { diff --git a/pkg/kwok/controllers/stage_controller.go b/pkg/kwok/controllers/stage_controller.go index a74847a2b..88964d6a0 100644 --- a/pkg/kwok/controllers/stage_controller.go +++ b/pkg/kwok/controllers/stage_controller.go @@ -240,6 +240,9 @@ func (c *StageController) playStageWorker(ctx context.Context) { if !ok { return } + if c.delayQueue.Len() > 10 { + go c.playStageWorker(ctx) + } c.delayQueueMapping.Delete(resource.Key) needRetry, err := c.playStage(ctx, resource.Resource, resource.Stage) if err != nil {