Skip to content

Extract shared sticky polling machinery - #1686

Merged
THardy98 merged 4 commits into
mainfrom
refactor/shared-sticky-poll-admission
Nov 2, 2026
Merged

THardy98 merged 4 commits into
mainfrom
refactor/shared-sticky-poll-admission

Conversation

@THardy98

@THardy98 THardy98 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Moves workflow sticky-polling machinery into shared types: poll admission into pollers/sticky.rs (StickyPollerShared), paired-buffer composition as StickyTaskPoller, and normal/sticky resource-based slot accounting.

Why?

Lets activity sticky polling (#1691) reuse it. Pure code movement; workflow polling remains the only consumer, so no behavior change.

Checklist

  1. Closes: N/A
  2. How was this tested: existing test suite.
  3. Any docs updates needed? No.

@THardy98
THardy98 force-pushed the refactor/shared-sticky-poll-admission branch from 6528f2c to 2ef5e4d Compare October 29, 2026 18:02
@Sushisource

Copy link
Copy Markdown
Member

High level: Do we need to do this? Could we just require that using the new affinity features means you have to use autoscaling?

Copy link
Copy Markdown
Contributor Author

Yeah that could work but we probably still want the poller starvation protection, which is the bulk of what's being ported here (wait_if_needed).

@Sushisource

Copy link
Copy Markdown
Member

Yeah that could work but we probably still want the poller starvation protection, which is the bulk of what's being ported here (wait_if_needed).

I thought the idea was, at least initially, that we'd be able to have the worker only poll on the sticky queue and we'd just transparently forward the request to the non-sticky queue on the server side.

I'm actually thinking, generally, we should move to that model for normal WFT sticky polling too. When you think about it there's really no real reason the worker needs to deal with all this sticky / not sticky logic... but that's a different story.

THardy98 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

initially, that we'd be able to have the worker only poll on the sticky queue and we'd just transparently forward the request to the non-sticky queue on the server side

Yeah, that's how it works for single-session workers: the sticky poll forwards to the normal queue until it picks up its first workflow, then it only polls sticky from then on.

For general session workers there's no forwarding at all. The worker polls the normal queue directly, and workflows it picks up get affinity through its sticky queue.

We could go sticky-only, the server needs forward on every sticky poll (or at least when sticky queue is empty), so the worker can keep picking up normal-queue work concurrently.

Polling both queues does the same thing, and supporting workers that take both session and non-session work seemed natural to me (giving our existing polling pattern).

Copy link
Copy Markdown
Contributor Author

I've started a discussion for sticky-only polling in the general session worker case

THardy98 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Based on discussion @Sushisource I think we're good to continue here

@THardy98
THardy98 merged commit a7d198e into main Nov 2, 2026
27 checks passed
@THardy98
THardy98 deleted the refactor/shared-sticky-poll-admission branch November 2, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog PR changes do not require changelog updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants