diff --git a/manager/router/router.go b/manager/router/router.go index 51038389c65..7d83fb3eeda 100644 --- a/manager/router/router.go +++ b/manager/router/router.go @@ -212,7 +212,7 @@ func Init(cfg *config.Config, logDir string, service service.Service, database * job.POST("", middlewares.RateLimit(cfg.Job.RateLimit.FillInterval, cfg.Job.RateLimit.Capacity, cfg.Job.RateLimit.Quantum), h.CreateJob) job.DELETE(":id", h.DestroyJob) job.PATCH(":id", h.UpdateJob) - job.GET(":id", h.GetJob) + job.GET(":id", middlewares.RateLimit(cfg.Job.RateLimit.FillInterval, cfg.Job.RateLimit.Capacity, cfg.Job.RateLimit.Quantum), h.GetJob) job.GET("", h.GetJobs) // Application. diff --git a/manager/service/job.go b/manager/service/job.go index 3f4eaa2de9a..0ccbe3bd22c 100644 --- a/manager/service/job.go +++ b/manager/service/job.go @@ -288,7 +288,7 @@ func (s *service) pollingJob(ctx context.Context, name string, id uint, groupID job models.Job log = logger.WithGroupAndJobID(groupID, fmt.Sprint(id)) ) - if _, _, err := retry.Run(ctx, 5, 10, 480, func() (any, bool, error) { + if _, _, err := retry.Run(ctx, 30, 300, 16, func() (any, bool, error) { groupJob, err := s.job.GetGroupJobState(name, groupID) if err != nil { log.Errorf("polling group failed: %s", err.Error()) diff --git a/test/testdata/charts/config-cache-list-metadata.yaml b/test/testdata/charts/config-cache-list-metadata.yaml index 26962f8e606..3e450c79305 100644 --- a/test/testdata/charts/config-cache-list-metadata.yaml +++ b/test/testdata/charts/config-cache-list-metadata.yaml @@ -152,3 +152,8 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 diff --git a/test/testdata/charts/config-compatibility.yaml b/test/testdata/charts/config-compatibility.yaml index ea4a51d29c0..8fe759fe997 100644 --- a/test/testdata/charts/config-compatibility.yaml +++ b/test/testdata/charts/config-compatibility.yaml @@ -149,6 +149,11 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 cache: redis: ttl: 1m diff --git a/test/testdata/charts/config-concurent-back-source.yaml b/test/testdata/charts/config-concurent-back-source.yaml index 8f5f3f44ce0..47d6ddf8dca 100644 --- a/test/testdata/charts/config-concurent-back-source.yaml +++ b/test/testdata/charts/config-concurent-back-source.yaml @@ -157,3 +157,8 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 diff --git a/test/testdata/charts/config-disable-seed-peer.yaml b/test/testdata/charts/config-disable-seed-peer.yaml index ac59acfbc23..566bae56aeb 100644 --- a/test/testdata/charts/config-disable-seed-peer.yaml +++ b/test/testdata/charts/config-disable-seed-peer.yaml @@ -121,3 +121,8 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 diff --git a/test/testdata/charts/config-grpc-tls-ipv6.yaml b/test/testdata/charts/config-grpc-tls-ipv6.yaml index bc1554e97c2..be90a107e3d 100644 --- a/test/testdata/charts/config-grpc-tls-ipv6.yaml +++ b/test/testdata/charts/config-grpc-tls-ipv6.yaml @@ -274,6 +274,11 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 security: autoIssueCert: true tlsPolicy: prefer diff --git a/test/testdata/charts/config-grpc-tls.yaml b/test/testdata/charts/config-grpc-tls.yaml index e70211b2a48..91219de4c27 100644 --- a/test/testdata/charts/config-grpc-tls.yaml +++ b/test/testdata/charts/config-grpc-tls.yaml @@ -268,6 +268,11 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 security: autoIssueCert: true tlsPolicy: prefer diff --git a/test/testdata/charts/config-ipv6.yaml b/test/testdata/charts/config-ipv6.yaml index 8c6eb348217..3c5d7f5194f 100644 --- a/test/testdata/charts/config-ipv6.yaml +++ b/test/testdata/charts/config-ipv6.yaml @@ -157,3 +157,8 @@ manager: verbose: true network: enableIPv6: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 diff --git a/test/testdata/charts/config-split-running-tasks.yaml b/test/testdata/charts/config-split-running-tasks.yaml index 255a5ae9b24..9026bd7505b 100644 --- a/test/testdata/charts/config-split-running-tasks.yaml +++ b/test/testdata/charts/config-split-running-tasks.yaml @@ -150,3 +150,8 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 diff --git a/test/testdata/charts/config-v2.yaml b/test/testdata/charts/config-v2.yaml index 230e4ba8e7d..601785a94c8 100644 --- a/test/testdata/charts/config-v2.yaml +++ b/test/testdata/charts/config-v2.yaml @@ -25,6 +25,11 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 scheduler: image: diff --git a/test/testdata/charts/config-write-buffer-size.yaml b/test/testdata/charts/config-write-buffer-size.yaml index cf916452e9c..d4375af04e6 100644 --- a/test/testdata/charts/config-write-buffer-size.yaml +++ b/test/testdata/charts/config-write-buffer-size.yaml @@ -153,6 +153,11 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 containerRuntime: containerd: diff --git a/test/testdata/charts/config.yaml b/test/testdata/charts/config.yaml index 7e28071c48d..2da99a5ae5d 100644 --- a/test/testdata/charts/config.yaml +++ b/test/testdata/charts/config.yaml @@ -149,6 +149,11 @@ manager: enable: true config: verbose: true + job: + rateLimit: + fillInterval: 1m + capacity: 100 + quantum: 100 containerRuntime: containerd: