Giter VIP home page Giter VIP logo

circleci-helper's Introduction

CircleCI helper binary for retrieving status of pipelines, workflows and jobs.

circleci-helper's People

Contributors

wojciechka avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

isabella232

circleci-helper's Issues

Context timeouts should be retried when waiting for jobs

We recently had a couple workflows fail with:

2021-12-10T17:51:58.489Z	INFO	Not all workflows / jobs have finished, waiting for 10 seconds
Error running command: Get "https://circleci.com/api/v2/workflow/REDACTED/job": context deadline exceeded

This should not cause the entire command to fail; there should be a retry.

I think the originating section of code is

result, err := internal.WaitForJobs(
ctx,
logger,
client,
internal.WaitForJobsOptions{
ProjectType: projectType,
Org: org,
Project: project,
PipelineNumber: pipelineNumber,
WorkflowNames: commaSeparatedListToSlice(workflow),
ExcludeJobNames: commaSeparatedListToSlice(exclude),
JobPrefixes: commaSeparatedListToSlice(jobPrefix),
FailOnError: failOnError,
WaitDuration: internal.NewWaitForJobsDuration(waitTime),
},
)
if err != nil {
return err
}

Reduce wait period from 30s to maybe 10s

// if one more workflows have not finished, wait and try again
sugar.Infof("Not all workflows / jobs have finished, waiting")
time.Sleep(30 * time.Second)

One of our bottleneck pipelines block on this call -- in the worst case we have to wait 30 seconds longer after the upstream jobs complete.

Dropping the wait period down to 10s would be an easy change to help the bottleneck complete faster, or we could allow it to be configurable.

I saw that the v1 API docs mention rate limiting:

For HTTP APIs, when a request is throttled, you will receive HTTP status code 429. If your integration requires that a throttled request is completed, then you should retry these requests after a delay, using an exponential backoff. In most cases, the HTTP 429 response code will be accompanied by the Retry-After HTTP header. When this header is present, your integration should wait for the period of time specified by the header value before retrying a request.

I am not seeing any docs on v2 API rate limiting.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.