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

SDKs should expose history length and size via Workflow info #16

Open
bergundy opened this issue Feb 1, 2022 · 7 comments
Open

SDKs should expose history length and size via Workflow info #16

bergundy opened this issue Feb 1, 2022 · 7 comments

Comments

@lorensr
Copy link
Contributor

lorensr commented Feb 1, 2022

Related:

We should give Workflow.isContinueAsNewNeeded flag to the SDKs. And it should be coming from the service.

https://temporaltechnologies.slack.com/archives/C01FT8U10GK/p1643400086752909?thread_ts=1643398281.925129&cid=C01FT8U10GK

@lorensr
Copy link
Contributor

lorensr commented Jun 14, 2023

I think we should expose shouldContinueAsNew as well in all SDKs.

  1. If server is able to take into account other things, then it's better than history length/size
  2. This:
if (workflowInfo().shouldContinueAsNew) {
  cAN()
}

is shorter & easier to read/understand compared to:

if (workflowInfo().historyLength < 10_000 && workflowInfo().historySize < 10_000_000) {
  cAN()
}
  1. We'll no longer need to teach people the right numbers to use

@cretz
Copy link
Member

cretz commented Jun 15, 2023

I think we should expose shouldContinueAsNew as well in all SDKs.

Concur, when available in server (no benefit in supporting before server). Or is it already available in server? What is the logic there and is it configurable?

@mjameswh
Copy link
Contributor

It will be important to mention in documentation the fact that relying on these properties is useless and dangerous if using an older server.

@cretz
Copy link
Member

cretz commented Jun 15, 2023

We could make it a capability and error (i.e. wft failure) if invoked for older server. But I think this is a good enough reason to not even expose this until it is available on cloud.

@cretz
Copy link
Member

cretz commented Aug 2, 2023

Note, we should call this "continue as new suggested" across all SDKs I think.

@cretz
Copy link
Member

cretz commented Aug 2, 2023

A caveat that SDKs need to note here: these three values may be delayed if viewed via query. Since the value is on wft start, a query-only poll response won't have updated history. So if you, say, sent a signal to start far-out 50 timers, and then, even after already in history stored, sent just a query, there is no new wft and therefore no value updates even though current event count is actually quite different on the server.

Basically every SDK needs to document that these values may be delayed if accessed in a query.

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

No branches or pull requests

5 participants