Skip to content

Expose Poller Automation #1691

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

Closed

Conversation

Sushisource
Copy link
Member

Needs #1679 to merge first

What was changed

Expose options to opt-in to new poller autoscaling behavior

Why?

Poller autoscaling is cool!

Checklist

  1. Closes

  2. How was this tested:
    Added simple test. More meaningful tests are in Core, we just need to make sure option is passed properly here.

  3. Any docs updates needed?

@Sushisource Sushisource requested a review from a team as a code owner April 23, 2025 02:26
'Second workflow poller count should be 1 or 2'
);

const workflowPromises = Array(20)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no test assertion pass this point. I suppose you only want to confirm it doesn't throw, but should at least do t.pass() or some other trivial check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always forget that's a thing. Seems so nonsense to me that you'd have to call pass explicitly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's technically not required in this specific case, as you already have some assertions earlier in the test, so yes, t.pass() will basically just be a noop, but it still clearly communicate to future readers that the absence of specific assertions in the second half of that test is intentional.

});

await Promise.all(workflowPromises);
worker.shutdown();
Copy link
Contributor

@mjameswh mjameswh Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure localEnv.teardown() below will hang the process if worker.shutdown() isn't called first (e.g. because of a thrown error above). Though that should be fixed by the refactor, so feel free to just ignore if that's not causing any harm to you.

* A poller behavior that will automatically scale the number of pollers based on feedback
* from the server. A slot must be available before beginning polling.
*/
export interface PollerBehaviorAutoscaling {
Copy link
Contributor

@mjameswh mjameswh Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this behavior marked as experimental?

maximum: behavior.maximum ?? 100,
};

const wftPollerBehavior = createPollerBehavior(maxWFTPolls, workflowTaskPollerBehavior);
Copy link
Contributor

@mjameswh mjameswh Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this per WFT poller types? Is there a risk that we might starve either regular or sticky task queue pollers (i.e. if min/initial/max set to 1)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I assume invalid configuration will be reported by Core?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to each independently, starvation won't occur. Yes, invalid config is reported by Core.

@mjameswh
Copy link
Contributor

Are we considering making autoscaling 1/5/100 be the default at some point? I'd expect that to give much better performance than our current default values and heuristics.

@Sushisource
Copy link
Member Author

Are we considering making autoscaling 1/5/100 be the default at some point? I'd expect that to give much better performance than our current default values and heuristics.

Yes, it should become the default eventually

@Sushisource Sushisource force-pushed the expose-poller-automation branch 2 times, most recently from c4fbec3 to 0f27727 Compare May 1, 2025 17:17
@Sushisource Sushisource force-pushed the worker-deployment-versioning branch from e7f4dd6 to 218743e Compare May 1, 2025 17:26
@Sushisource Sushisource force-pushed the expose-poller-automation branch from 0f27727 to 3ed9b7c Compare May 1, 2025 17:27
@Sushisource Sushisource force-pushed the worker-deployment-versioning branch from 218743e to 8169797 Compare May 2, 2025 01:06
@Sushisource
Copy link
Member Author

No longer needed

@Sushisource Sushisource closed this May 6, 2025
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 this pull request may close these issues.

2 participants