From Uber's Cadence doc, it says that a single workflow cannot expect to run more than 100k activities over the lifecycle of the workflow. https://cadenceworkflow.io/docs/concepts/workflows/#child-workflow
A single workflow has a limited size. For example, it cannot execute 100k activities. Child workflows can be used to partition the problem into smaller chunks. One parent with 1000 children each executing 1000 activities is 1 million executed activities.
I was wondering if cadence imposes somewhat similar limits to # of state changes due to many signals received?
In my use case, I have a long running (months to years long) workflows that each workflow will track user's activity for game system. Total number of signals that each user workflow will receive can go over 100k every few days, which leads to more than 100k workflow state changes.
The thing is that each signal won't necessarily invoke activity calls in my business logic, so the total number of activities invoked per workflow can stay low. (e.g. 100 activity calls total while signal received are over 100k)
It wasn't clear to me if cadence doc reference to 100k activities limits is applied only for total number of activity calls or total number of all state changes (activities, signals, query, etc).
Does uber-cadence framework enforce limits on the number of signals received over the lifecycle of a workflow?
Yes. It is 10K by default . See MaximumSignalsPerExecution
in https://pkg.go.dev/github.com/uber/cadence@v0.23.1/common/dynamicconfig#Key
To be more accurate, this 10K signal limit is starting from 0.16 version from this commit: https://github.com/uber/cadence/commit/0993f6ebb0ceda610f9e47fe8569db50485b0e18
Version less than 0.16 doesn't have any limit.
When sending more than limit number of signals to a workflow, Cadence will reject the signal request.
Total number of signals that each user workflow will receive can go over 100k every few days, which leads to more than 100k workflow state changes.In this scenario, will cadence workflow throw any error because internal history of the workflow is too long to keep track of 100k+ signals received, despite having only hundreds of activities calls per guidelines in the doc?
Cadence by default require history to be less than 200K
See HistoryCountLimitError
in https://pkg.go.dev/github.com/uber/cadence@v0.23.1/common/dynamicconfig#Key
When the history grows over this limit, Cadence will terminate the workflow immediately. However, you can adjust the config and then reset the workflow back.