Skip to content

Commit

Permalink
feat: increase interval of the preheat polling (#3544)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Sep 29, 2024
1 parent 7a83e5a commit 7253f0f
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manager/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion manager/service/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
5 changes: 5 additions & 0 deletions test/testdata/charts/config-cache-list-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,8 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
5 changes: 5 additions & 0 deletions test/testdata/charts/config-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
cache:
redis:
ttl: 1m
Expand Down
5 changes: 5 additions & 0 deletions test/testdata/charts/config-concurent-back-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,8 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
5 changes: 5 additions & 0 deletions test/testdata/charts/config-disable-seed-peer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
5 changes: 5 additions & 0 deletions test/testdata/charts/config-grpc-tls-ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
security:
autoIssueCert: true
tlsPolicy: prefer
Expand Down
5 changes: 5 additions & 0 deletions test/testdata/charts/config-grpc-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
security:
autoIssueCert: true
tlsPolicy: prefer
Expand Down
5 changes: 5 additions & 0 deletions test/testdata/charts/config-ipv6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,8 @@ manager:
verbose: true
network:
enableIPv6: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
5 changes: 5 additions & 0 deletions test/testdata/charts/config-split-running-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,8 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100
5 changes: 5 additions & 0 deletions test/testdata/charts/config-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100

scheduler:
image:
Expand Down
5 changes: 5 additions & 0 deletions test/testdata/charts/config-write-buffer-size.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100

containerRuntime:
containerd:
Expand Down
5 changes: 5 additions & 0 deletions test/testdata/charts/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ manager:
enable: true
config:
verbose: true
job:
rateLimit:
fillInterval: 1m
capacity: 100
quantum: 100

containerRuntime:
containerd:
Expand Down

0 comments on commit 7253f0f

Please sign in to comment.