Skip to content

Port the federation worker and scheduled jobs to Node.js #350

Description

@dahlia

Problem

The background process uses Deno.cron and Deno.addSignalListener to schedule maintenance jobs, drain the Fedify queue, and coordinate graceful shutdown. These runtime concerns are mixed with the job implementations.

Tasks

  • Extract each scheduled job into an independently callable operation.
  • Define schedule metadata separately from job logic.
  • Add a Node.js scheduler adapter with abortable shutdown.
  • Replace Deno signal handling with Node.js process-signal handling.
  • Preserve PostgreSQL advisory locks, leasing, replica safety, and queue-drain behavior.
  • Revalidate Fedify queue startup and shutdown semantics.
  • Add tests for overlapping ticks, skipped locks, failures, cancellation, and graceful termination.

Acceptance criteria

  • The federation queue and every scheduled job run under Node.js.
  • Multiple worker replicas preserve the existing concurrency and idempotency guarantees.
  • Shutdown stops new ticks, drains active work within the documented policy, and exits cleanly.
  • The worker remains a separate process and is not placed behind a load balancer.

AI assistance: This issue was drafted and organized with Codex after a maintainer-led code audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfederationActivityPub federationgraphqlGraphQL API server

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions