cookpad / kuroko2

Kuroko2 is a web-based job scheduler / workflow engine.
MIT License
313 stars 72 forks source link

Prevent from propagating env vars at outside of fork task scope #128

Closed itkq closed 5 years ago

itkq commented 5 years ago

Since deserialized context value of Token model by getting through AttributeSet#attributes is passed by reference, additional env values passed to create_child_token method overwrite a context which a token instance variable has. This cause unintentional env values propagation like KUROKO2_PARALLEL_FORK_SIZE at outside of the fork task scope.

To avoid this, use the deep copy for context value instead.

@cookpad/infra please review

itkq commented 5 years ago

Thanks for reviewing!