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(titus): Fix SagaContext wiring in DeployHandler cases #4070

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

robzienert
Copy link
Member

It turns out that TitusDeployHandler (and other DeployHandler classes) are singleton components
that get injected into prototype AtomicOperation components, which I didn't realize until now.
The issue with this is that I was setting request-scoped context into a singleton bean, which
could lead to some neat concurrency bugs. This change modifies things for DeployAtomicOperation
specifically to inject the SagaContext into the description (which is actually request-scoped)
rather than passing through to the TitusDeployHandler object.

There's also this neat feature I discovered while working through this where we convert the raw request input into an atomic operation description twice, throwing away the first conversion after we've validated the input. Not sure why we do this, but it seems like something we could make better someday.

It turns out that TitusDeployHandler (and other DeployHandler classes) are singleton components
that get injected into prototype AtomicOperation components, which I didn't realize until now.
The issue with this is that I was setting request-scoped context into a singleton bean, which
could lead to some neat concurrency bugs. This change modifies things for DeployAtomicOperation
specifically to inject the SagaContext into the description (which is actually request-scoped)
rather than passing through to the TitusDeployHandler object.
Copy link
Contributor

@cfieber cfieber left a comment

Choose a reason for hiding this comment

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

woof - good catch

@aravindmd
Copy link
Contributor

good to know , thanks for looping me in !

@robzienert robzienert merged commit 420256f into spinnaker:master Oct 3, 2019
@robzienert robzienert deleted the fix-saga-context-wiring branch October 3, 2019 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants