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

MaxConcurrentActivityExecutionSize is not honored when default value for TaskListActivitiesPerSecond is used. #1310

Open
petergardfjall opened this issue Feb 12, 2024 · 0 comments
Labels

Comments

@petergardfjall
Copy link

petergardfjall commented Feb 12, 2024

Describe the bug
We recently discovered that Cadence does not honor MaxConcurrentActivityExecutionSize when the default value for TaskListActivitiesPerSecond is used. Notably it seemed that whenever we started a workflow, the worker would start about twice the amount of activities that we had configured. Not good, since we are trying to protect a downstream resource from being oversubscribed.

After some debugging I think I found the offending code in internal_worker.go#L1025 and the creation of a "locally dispatched activity worker" (originally introduced in #1029).

There is a workaround in setting TaskListActivitiesPerSecond to anything but the default, since that prevents the creation of the "extra" activity worker. Still this is surprising, incorrect and undocumented behavior.

To Reproduce
Is the issue reproducible?

  • Yes

Steps to reproduce the behavior:

  • Start one worker with MaxConcurrentActivityExecutionSize: 1 and make sure TaskListActivitiesPerSecond is kept at its default value (100000.0).
    • Let the worker handle a simple workflow with one activity lasting at least a few seconds.
  • Have a client start two such workflows in quick succession.
  • Watch both workflow activities being concurrently executed despite MaxConcurrentActivityExecutionSize being 1.

Expected behavior
I expected the first activity to start and execute until completion before the second activity was allowed to start (given the worker setting: MaxConcurrentActivityExecutionSize: 1).

@petergardfjall petergardfjall changed the title MaxConcurrentActivityExecutionSize is not honored when default value for MaxConcurrentDecisionTaskExecutionSize is used. MaxConcurrentActivityExecutionSize is not honored when default value for TaskListActivitiesPerSecond is used. Feb 12, 2024
@ibarrajo ibarrajo added the bug label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants