Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jenkins): Don't kick off multiples of the same build #863

Merged
merged 3 commits into from
Sep 22, 2020

Conversation

marchello2000
Copy link
Contributor

@marchello2000 marchello2000 commented Sep 18, 2020

The issue here is that when an operation takes a long time (e.g. talking to jenkins to kick off a build)
the prolonged time can cause orca to try to resubmit the request multiple times thus kicking off multiple (or infinite number of) builds.

We solve this, by setting a flag that a given request (keyed of X-SPINNAKER-REQUEST-ID and master/job/param) is being processed so if an identical request comes in the controller can detect it and respond with 202 ACCEPTED. This will cause orca to retry (see spinnaker/orca#3915).
When the job is finally kicked off, the resulting build number will be stored in the cache and next time orca queries it will get the build number back

The issue here is that when an operation takes a long time (e.g. talking to jenkins to kick off a build)
this prolonged time can cause orca to try to resubmit the request multiple times thus kicking off multiple (or infinite number of) builds.

We solve this, but setting a flag that a given request (keyed of X-SPINNAKER-REQUEST-ID and master/job/param) is being processed so if an identical
request comes in the controller can detect that and respond with 202 ACCEPTED. This will cause orca to retry (corresponding PR coming).
When the job is finally kicked off, the resulting build number will be stored in the cache and next time orca queries it will get the build number back
marchello2000 added a commit to marchello2000/orca that referenced this pull request Sep 18, 2020
This a companion PR to spinnaker/igor#863

The issue here is that when kicking off a build takes a long time (e.g. when jenkins has a lot of job configs) orca might kick off a lot of builds instead of just one (and might still fail!)
Igor now adds support for "pending" operation so if the same request is received twice it will return 202. This change adds the corresponding support to orca, on 202, we just need to retry, because eventually igor will give us the build number
@marchello2000
Copy link
Contributor Author

IntelliJ decided to reformat the spacing.. so review with white space off : https://github.com/spinnaker/igor/pull/863/files?diff=split&w=1
Also, here is corresponding orca PR (spinnaker/orca#3915)

Copy link
Contributor

@srekapalli srekapalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marchello2000
Copy link
Contributor Author

LGTM

thank you!

@marchello2000 marchello2000 added the ready to merge Approved and ready for merge label Sep 22, 2020
@mergify mergify bot added the auto merged label Sep 22, 2020
@mergify mergify bot merged commit 9bc8606 into spinnaker:master Sep 22, 2020
@marchello2000 marchello2000 deleted the mark/jenkins_dedupe branch September 22, 2020 21:19
mergify bot added a commit to spinnaker/orca that referenced this pull request Sep 22, 2020
* fix(igor): Handle timeouts kicking off builds

This a companion PR to spinnaker/igor#863

The issue here is that when kicking off a build takes a long time (e.g. when jenkins has a lot of job configs) orca might kick off a lot of builds instead of just one (and might still fail!)
Igor now adds support for "pending" operation so if the same request is received twice it will return 202. This change adds the corresponding support to orca, on 202, we just need to retry, because eventually igor will give us the build number

* fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fixup! fixup! fix(igor): Handle timeouts kicking off builds

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
amanya pushed a commit to amanya/orca that referenced this pull request Oct 23, 2020
* fix(igor): Handle timeouts kicking off builds

This a companion PR to spinnaker/igor#863

The issue here is that when kicking off a build takes a long time (e.g. when jenkins has a lot of job configs) orca might kick off a lot of builds instead of just one (and might still fail!)
Igor now adds support for "pending" operation so if the same request is received twice it will return 202. This change adds the corresponding support to orca, on 202, we just need to retry, because eventually igor will give us the build number

* fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fixup! fixup! fix(igor): Handle timeouts kicking off builds

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
KathrynLewis pushed a commit to KathrynLewis/orca that referenced this pull request Jan 31, 2021
* fix(igor): Handle timeouts kicking off builds

This a companion PR to spinnaker/igor#863

The issue here is that when kicking off a build takes a long time (e.g. when jenkins has a lot of job configs) orca might kick off a lot of builds instead of just one (and might still fail!)
Igor now adds support for "pending" operation so if the same request is received twice it will return 202. This change adds the corresponding support to orca, on 202, we just need to retry, because eventually igor will give us the build number

* fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fixup! fix(igor): Handle timeouts kicking off builds

* fixup! fixup! fixup! fixup! fix(igor): Handle timeouts kicking off builds

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants