You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rust #325: serve worker sessions like Server 2.11.1 #736
Native serves worker sessions exactly as published Server 2.11.1 does. A shared fixture recorded against published PHP proves it.
Routes in scope (native answers 501 today):
POST /api/worker/sessions
POST /api/worker/sessions/{sessionId}/heartbeat
DELETE /api/worker/sessions/{sessionId}
GET /api/worker-sessions
GET /api/worker-sessions/{sessionId}
The port also covers the places sessions touch other routes:
activity scheduling with worker_session;
activity task delivery, heartbeat and renew-lease (the worker_session field);
registration and capability advertisement (PHP serves worker_sessions as an object with the verbs create, heartbeat and close);
operator metrics;
namespace cleanup;
takeover of PHP data that holds sessions.
Published behavior to match
The routes need protocol 1.8 or newer. Older headers get 409 worker_sessions_unavailable. Creating sessions from a workflow task needs 1.18 or newer and the worker_sessions capability.
Create checks run in this order: protocol, validation, registration (412), queue (409), requirements (409). It answers 201 created or 200 reused / reacquired, and the body repeats the status.
Sessions expire only when they are read; there is no background sweeper. A holder becomes orphaned after deregistration or after 30 seconds without a worker heartbeat.
Session times are kept in whole seconds.
Acceptance
A fixture recorded against published 2.11.1 first, on its own queues. It covers create, reuse and reacquire, heartbeat, close, expiry on read, holder loss, listing order, the refusals in order, and activity delivery tied to a session.
Native passes it on SQLite, the MySQL family and PostgreSQL, with execution-test counterfactuals.
No expected result is changed to make native pass. Where published PHP itself misbehaves, an explicit, documented boundary separates that from native behavior, and the defect is reported to the PHP owner.
Fixtures recorded against published 2.11.1, each in 3 identical recordings, published PHP and embedded pass:
worker-sessions: lifecycle routes, gates and refusals, expiry and orphaning on read, listing and metrics.
worker-session-activities: schedule_activity guards, lazy creation on the first admitted claim, the claim pre-filter and held session, heartbeat and renew-lease renewal, the compact form on status, the closed-session refusals, the activity limit, an unclaimable queue, operator metrics, and the capability object.
Native, implemented locally: all five routes, session-bound activities (completion guards, claim admission, heartbeat, renew-lease and status), the worker_sessions capability object with its verbs, and operator metrics.
Both fixtures pass against native locally.
Native execution tests pass on SQLite, PostgreSQL and MySQL.
Activity
rmcdaniel commentedon Oct 24, 2026
Progress (Rust Server owner):
worker-sessions: lifecycle routes, gates and refusals, expiry and orphaning on read, listing and metrics.worker-session-activities: schedule_activity guards, lazy creation on the first admitted claim, the claim pre-filter and held session, heartbeat and renew-lease renewal, the compact form on status, the closed-session refusals, the activity limit, an unclaimable queue, operator metrics, and the capability object.failure_reason.worker_sessionscapability object with its verbs, and operator metrics.upgrade_source_worker_sessions_unsupported).