Repository navigation
Controller: Connect stream, worker sessions and the worker client - #2
Merged
Merged
Conversation
- Connect requires the worker's current client certificate; the worker is identified by the certificate, never by what it says in Hello - Sessions with heartbeats, a silence timeout, a registry the scheduler can send through, and replacement when the same worker reconnects - Revocation: controller worker revoke disconnects at once; workers revoked elsewhere are dropped at the next periodic check - pkg/worker: Join saves the identity to disk; Client connects, sends heartbeats and reconnects with jittered backoff, stopping for good when the controller rejects the worker permanently - internal/controller/api: handler and TLS config shared by the binary and tests - Integration tests: real controller, PostgreSQL and worker client over TLS - controller worker list and controller worker revoke Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KristiforMilchev
added a commit
that referenced
this pull request
Nov 3, 2026
…ains #2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second part of milestone M1: workers stay connected to the controller.
Controller
Connectrequires the worker's client certificate, and it must be the worker's current one. The worker is identified by its certificate, never by what it sends in Hello.controller worker revoke <id>disconnects a worker immediately, and it can't reconnect. A worker revoked through another controller is dropped at the next periodic check, which runs every 30s.controller worker listshows workers, pools and when each was last seen.Worker kit (
pkg/worker)Joingenerates the private key locally, joins, and saves the identity to disk.Clientconnects, sends heartbeats, delivers controller messages in order and reconnects with jittered backoff. It stops for good if the controller rejects it as revoked or unknown.Tests: integration tests run a real controller with PostgreSQL and the real worker client over TLS. They cover:
They passed 10 times in a row under the race detector.
Next: runs, jobs and the scheduler.
🤖 Generated with Claude Code