Skip to content

List and describe workers natively, and release a replaced worker's activity leases - #544

Merged
rmcdaniel merged 8 commits into
rust-325-terminatefrom
rust-325-worker-listing
Oct 20, 2026
Merged

rmcdaniel merged 8 commits into
rust-325-terminatefrom
rust-325-worker-listing

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Part of #325: API parity for worker management. Stacked on #543 (terminate); review that first.

Worker listing

Native serves GET /api/workers and GET /api/workers/{id}, as published PHP's WorkerManagementController does:

  • PHP's summary fields;
  • the task_queue and status filters, with stale workers hidden unless asked for;
  • the stale window;
  • 404 worker_not_found.

Operators may read these; only DELETE needs an admin. Named namespaces may read them.

Registration and heartbeat facts

Registration and heartbeat now keep what PHP keeps:

  • capacities, defaulting to 100, 100 and 10;
  • task slots, bounded by those capacities;
  • normalized process metrics;
  • the heartbeat cadence;
  • workflow definition fingerprints.

Re-registering an active worker with a changed fingerprint is refused with 409 workflow_definition_changed. Omitting an advertised one is refused with 409 workflow_definition_fingerprint_missing. Neither refusal changes the registration. A heartbeat changes only what it reports, and its acknowledgement carries the configured cadence and stale window. PHP's heartbeat also reports an inline history retention pass. Native has no retention yet, so it omits that report rather than claim one; the port log lists this gap.

A replaced worker's activity leases

A new process registering a worker_id that holds activity leases now releases them at once, as PHP does:

  • its running attempts close as expired;
  • the tasks return to ready, so the next claim is attempt 2 of the same task.

Native used to leave the task leased for the five-minute activity lease. The expired attempt's completion now gets PHP's whole stale receipt: 409 stale_attempt, recorded: false, and the activity, attempt and task statuses.

Fixtures

  • worker-listing registers two workers through the unchanged published SDK. It then lists, filters, describes and refuses them, and re-registers and deregisters them.
  • worker-replacement-activity-lease replaces a worker that holds an activity lease, then completes the original and replacement attempts.

The contracts check each HTTP target against the reviewed facts, with mutation unit tests. Embedded mode is explicitly inapplicable.

Checks

  • A local copy of the SQLite parity step recorded published PHP 2.5.14, embedded PHP and native for both fixtures and namespace-isolation. Every target passed, and the comparison passed.
  • Before the release change, native failed the replacement fixture: its second claim found no task.
  • The native integration tests pass on SQLite, PostgreSQL, MySQL and MariaDB.
  • The SQLite library and execution suites pass, and so do the 300 comparator unit tests.

The port log also gets a refreshed current state and an inventory of the API surface still missing (native now serves 63 of PHP 2.9.8's 173 routes).

This branch's parity run qualifies #543 too.

🤖 Generated with Claude Code

durable-workflow-ops and others added 7 commits October 20, 2026 15:10
Native serves GET /api/workers and GET /api/workers/{id} with PHP's
summary, filters, stale window and refusals. Registration and heartbeat
now keep the facts PHP reports: capacities, bounded task slots, process
metrics, heartbeat cadence and workflow definition fingerprints.
Re-registering with a changed or omitted fingerprint is refused, as PHP
refuses it.

A worker-listing fixture drives this through the unchanged published SDK.

Part of #325.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…5-worker-listing

# Conflicts:
#	docs/rust-server-port.md
A new process registering a worker_id that holds activity leases now
closes its running attempts as expired and returns the tasks to ready,
so the next claim is attempt 2 of the same task. Native used to leave the
task leased for the whole five-minute activity lease. The expired
attempt's late completion gets PHP's whole stale receipt.

A worker-replacement-activity-lease fixture checks this through the
unchanged published SDK.

Part of #325.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

Parity run failures so far are infrastructure, not code. Around 16:39–16:40 UTC, mirror.gcr.io refused image pulls with toomanyrequests: Quota exceeded for the pinned Rust, MariaDB and MySQL images. That failed "Fetch locked Rust dependencies" and the codec-deadline-health binary checks before any test ran. I'll rerun the failed jobs once the run completes.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Run 39455077773 has three failed jobs, and all three are infrastructure failures. mirror.gcr.io returned toomanyrequests (quota exceeded) while pulling the pinned images:

  • mysql-execution (mysql-8.0): the Rust image;
  • postgres-storage (pg17): the Rust and PostgreSQL images;
  • codec-deadline-health (mariadb-10.11).

The steps after each failed pull failed because they had no image. I'll rerun the failed jobs once the last job finishes.

@rmcdaniel
rmcdaniel merged commit 5f25492 into rust-325-terminate Oct 20, 2026
30 of 33 checks passed
@rmcdaniel
rmcdaniel deleted the rust-325-worker-listing branch October 20, 2026 19:33
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