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

[Feature Request] Clarify continue-as-new signal draining for Go #781

Closed
cretz opened this issue Dec 10, 2021 · 3 comments · Fixed by #1216
Closed

[Feature Request] Clarify continue-as-new signal draining for Go #781

cretz opened this issue Dec 10, 2021 · 3 comments · Fixed by #1216
Assignees

Comments

@cretz
Copy link
Member

cretz commented Dec 10, 2021

Is your feature request related to a problem? Please describe.

At https://docs.temporal.io/docs/concepts/workflows#faq, there is a note for continue-as-new that says:

If you are using Signals with the Go SDK, you should make sure to do an asynchronous drain on the Signal channel or the Signals will be lost.

But it is not in the Go docs that I can find

Describe the solution you'd like

In the Go documentation for continue-as-new and maybe also for signals, this same thing should be mentioned

@flossypurse
Copy link
Contributor

Thanks @cretz !
Per our feature specification plan - what we are probably looking at doing here is refining answers to the following questions:

  • What is Continue-As-New
  • How to use Continue-As-New in Go

Can you point us to examples for Go that shows as "asynchronous drain" on the Signal channel?
What does it mean to drain the channel - what are the consequences if you do not? That kind of context would be helpful if you have it.

@cretz
Copy link
Member Author

cretz commented Dec 14, 2021

what we are probably looking at doing here is refining answers to the following questions:

Understood. In this tiny issue though, I was just pointing out there's a Go note in the non-Go section that isn't even in the Go section. I think this note can be added to the Go section before taking on the larger task of clarifying.

Can you point us to examples for Go that shows as "asynchronous drain" on the Signal channel?

temporalio/samples-go#158 has been opened to add the sample.

What does it mean to drain the channel - what are the consequences if you do not? That kind of context would be helpful if you have it.

It means there isn't a signal in buffer. This is unique to how Go handles signals I believe (others use callbacks). My understanding is you can lose signals if you continue-as-new before handling all locally buffered signals.

@mastermanu
Copy link
Member

We should also warn against the following usage issue highlighted here: temporalio/sdk-go#197

In essence, if the workflow is kicked off via a string, then continue-as-new should also use a string vs using the method pointer. otherwise you see weird behavior where continue-as-new starts a different workflow.

@DJSanti DJSanti self-assigned this May 27, 2022
@DJSanti DJSanti linked a pull request Jun 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants