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(jobs): fix race condition in override #2988

Merged

Conversation

ethanfrogers
Copy link
Contributor

@ethanfrogers ethanfrogers commented Jun 17, 2019

fixes a case where parameter overrides would override the base job
configuration as well as the job in the context. this is because the
previous implementation would assign a reference to context[it]
instead of a copy. when the parameter overriding was done it would not
only modify the fields in context but also the base configuration. this
presented itself when running > 1 job in parallel. by focing a new copy
(via converValue for simplicity) we get a fresh object reference we
can assign.

fixes spinnaker/spinnaker#4487

fixes a case where parameter overrides would override the base job
configuration as well as the job in the context. this is because the
previous implementation would assign a reference to `context[it]`
instead of a copy. when the parameter overriding was done it would not
only modify the fields in context but also the base configuration. this
presented itself when running > 1 job in parallel. by focing a new copy
(via `converValue` for simplicity) we get a fresh object reference we
can assign.

fixes spinnaker/spinnaker#4487
Copy link
Contributor

@ezimanyi ezimanyi left a comment

Choose a reason for hiding this comment

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

👍

@ethanfrogers ethanfrogers merged commit e66bbc9 into spinnaker:master Jun 17, 2019
@ethanfrogers ethanfrogers deleted the fix-preconfigured-job-race branch June 17, 2019 19:41
@ethanfrogers
Copy link
Contributor Author

@spinnakerbot cherry-pick 1.14

@spinnakerbot
Copy link
Contributor

Cherry pick failed: Command failed (cherry pick commit e66bbc9) with exit code 1:

error: could not apply e66bbc964... fix(jobs): fix race condition in override (#2988)
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

ethanfrogers added a commit to ethanfrogers/orca that referenced this pull request Jun 18, 2019
fixes a case where parameter overrides would override the base job
configuration as well as the job in the context. this is because the
previous implementation would assign a reference to context[it]
instead of a copy. when the parameter overriding was done it would not
only modify the fields in context but also the base configuration. this
presented itself when running > 1 job in parallel. by focing a new copy
(via converValue for simplicity) we get a fresh object reference we
can assign.

Note - manual patch from spinnaker#2988
ethanfrogers added a commit that referenced this pull request Jun 18, 2019
fixes a case where parameter overrides would override the base job
configuration as well as the job in the context. this is because the
previous implementation would assign a reference to context[it]
instead of a copy. when the parameter overriding was done it would not
only modify the fields in context but also the base configuration. this
presented itself when running > 1 job in parallel. by focing a new copy
(via converValue for simplicity) we get a fresh object reference we
can assign.

Note - manual patch from #2988
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong job parameters in Custom Job Stage when invoked in parallel
3 participants