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 WorkflowPool to work with ConflatedBroadcastChannel. #475

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

zach-klippenstein
Copy link
Collaborator

Before, the renderings stream came from a regular Channel, and the replay/caching
happened downstream. In the legacy integration code, this meant that when a V2 workflow emitted
an output and got cancelled, the pool would immediately see the renderings channel was closed on the next
onWorkflowUpdate and emit Finished. Now that it's backed by a ConflatedBroadcastChannel, it will
always emit the last-emitted value on subscription before sending the close signal. This means the
pool will always see the last state, and emit Running, which means the v2 workflow just gets restarted
on the next iteration. Fixed by explicitly checking the isActive flag on the workflow's job before
emitting Running.

@zach-klippenstein zach-klippenstein added this to the kotlin v0.18.0 milestone Jul 18, 2019
@zach-klippenstein zach-klippenstein added this to In progress in Workflow (Kotlin) via automation Jul 18, 2019
Before, the renderings stream came from a regular `Channel`, and the replay/caching
happened downstream. In the legacy integration code, this meant that when a V2 workflow emitted
an output and got cancelled, the pool would immediately see the renderings channel was closed on the next
`onWorkflowUpdate` and emit `Finished`. Now that it's backed by a `ConflatedBroadcastChannel`, it will
always emit the last-emitted value on subscription before sending the close signal. This means the
pool will always see the last state, and emit `Running`, which means the v2 workflow just gets restarted
on the next iteration. Fixed by explicitly checking the `isActive` flag on the workflow's job before
emitting `Running`.
@zach-klippenstein
Copy link
Collaborator Author

Note this is merging into the release branch for 0.18.0.

@zach-klippenstein zach-klippenstein merged commit 384c420 into release-v0.18.0 Jul 18, 2019
Workflow (Kotlin) automation moved this from In progress to Done Jul 18, 2019
@zach-klippenstein zach-klippenstein deleted the zachklipp/fix-workflowpool branch July 18, 2019 00:45
@zach-klippenstein zach-klippenstein added the kotlin Affects the Kotlin library. label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kotlin Affects the Kotlin library.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants