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

Broadcast work-available to worker when runs are enqueued #2934

Open
stuartc opened this issue Feb 13, 2025 · 0 comments
Open

Broadcast work-available to worker when runs are enqueued #2934

stuartc opened this issue Feb 13, 2025 · 0 comments
Labels
performance Issues that may affect scalability or performance under stress

Comments

@stuartc
Copy link
Member

stuartc commented Feb 13, 2025

See: OpenFn/kit#869

Details

In order to preempt the worker backing off when there is nothing to claim, we're proposing that the WorkerChannel subscribes to events emitted when a run is created and then send a work-available event to the worker.

We may need to leverage the worker version API, as we don't want to send a message to a version of the worker that might error out when receiving an unknown message.

Implementation notes

We need to be respectful of the inbox of the worker channel, when runs are created it will be a lot of messages, often dozens or hundreds in a single minute. It’s unlikely there is enough worker capacity to deal with all of those at once, we should subscribe in a different process and debounce the events calling the parent (worker channel process) at most every 500ms, with a leading call (call immediately if there is no timer, and after 500ms if there are subsequent events).

Release notes

User acceptance criteria

@stuartc stuartc added the performance Issues that may affect scalability or performance under stress label Feb 13, 2025
@stuartc stuartc moved this to Backlog in v2 Feb 13, 2025
@stuartc stuartc added this to v2 Feb 13, 2025
@stuartc stuartc moved this from Backlog to Ready in v2 Feb 13, 2025
@theroinaochieng theroinaochieng moved this from Ready to In progress in v2 Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues that may affect scalability or performance under stress
Projects
Status: In progress
Development

No branches or pull requests

1 participant