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

User-implementable SlotSupplier #1553

Merged
merged 13 commits into from
Nov 6, 2024
Merged

User-implementable SlotSupplier #1553

merged 13 commits into from
Nov 6, 2024

Conversation

Sushisource
Copy link
Member

@Sushisource Sushisource commented Oct 25, 2024

What was changed

Add user-implementable slot suppliers

Why?

Parity. Cool feature.

Checklist

  1. Closes

  2. How was this tested:
    Added tests

  3. Any docs updates needed?
    Yes, will be updating docs pages after all Core langs are done

@Sushisource Sushisource force-pushed the user-slot-supplier branch 2 times, most recently from 871abb6 to 79cdf8e Compare November 1, 2024 01:12
@Sushisource
Copy link
Member Author

Requires #1553 to merge before it can compile

@Sushisource Sushisource changed the title [DRAFT] User-implementable SlotSupplier User-implementable SlotSupplier Nov 1, 2024
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM. Besides the fact that these will be called CustomSlotSuppliers and Go and Java get to just use SlotSupplier, I like that everything else is basically the same.

/**
* The interface can be implemented to provide custom slot supplier behavior.
*/
export interface CustomSlotSupplier<SI extends SlotInfo> {
Copy link
Member

Choose a reason for hiding this comment

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

I noticed that a "maximum slots" getter isn't here. I think that's a good thing, just noticing the mismatch with Go/Java.

reserveSlot(ctx: SlotReserveContext, abortSignal: AbortSignal): Promise<SlotPermit>;

/**
* This function is called when trying to reserve slots for "eager" workflow and activity tasks.
Copy link
Contributor

@mjameswh mjameswh Nov 1, 2024

Choose a reason for hiding this comment

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

There's no case of eager workflow task in TS at this point. Might want to adjust the doc accordingly. Or not.

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 think I'll leave it as is for when we maybe reintroduce

// Defaults to 1000 for workflow tasks and 2000 for activity tasks.
/**
* Maximum amount of slots permitted
* Defaults to 1000 for workflow tasks and 2000 for activity tasks.
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is not new from this PR, but reading this again makes me think… Isn't 1000/2000 ridiculously high as defaults? Or will this effectively get capped by some other limit anyway (I mean, something else than only resource usage).

IIRC, the default namespace config in Cloud is to limit the total number of polers to 2000. Could we get in a situation where the RB provider would allow that many slots in polling state at the same time, from the same worker?

Should we have a distinct limit for the number of slots that have been allowed but haven't yet been "marked as in-use"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it is, but the idea is it's supposed to be capped by the resource tuner long before it gets to that point. So, not something else, but that.

Good question about the polling, but right now no way, and when I do poller tuning I'll have to consider that of course. Probably there is also just a different limit on max polling ceiling which will in effect restrict this (or this will be bound to that)

Copy link
Contributor

@mjameswh mjameswh left a comment

Choose a reason for hiding this comment

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

Awesome!

@Sushisource Sushisource merged commit 5c3955f into main Nov 6, 2024
86 checks passed
@Sushisource Sushisource deleted the user-slot-supplier branch November 6, 2024 19:59
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.

3 participants