Skip to content

Remove legacy TheSchwartz ESN workers and ESN_OVER_SQS tunable#3520

Merged
zorkian merged 4 commits intodreamwidth:mainfrom
zorkian:remove-legacy-esn-workers
Feb 15, 2026
Merged

Remove legacy TheSchwartz ESN workers and ESN_OVER_SQS tunable#3520
zorkian merged 4 commits intodreamwidth:mainfrom
zorkian:remove-legacy-esn-workers

Conversation

@zorkian
Copy link
Member

@zorkian zorkian commented Feb 15, 2026

$LJ::ESN_OVER_SQS has been set to 1 in production, meaning 100% of ESN events route through
DW::TaskQueue (SQS). The four legacy TheSchwartz-based ESN workers have been consuming no work.
This removes the legacy path entirely so ESN always uses the modern DW::Task::ESN::* pipeline.

Perl changes:

  • DW::TaskQueue::dispatch() now unconditionally calls fire_task for LJ::Event objects,
    removing the $LJ::ESN_OVER_SQS percentage-based routing split
  • LJ::Event::fire_job() deleted; process_fired_events() rewritten to drain DW::TaskQueue
    synchronously (used by the ESN test suite)
  • LJ::ESN: removed schwartz_capabilities(), process_fired_events(),
    jobs_of_unique_matching_subs(), and all four LJ::Worker::* packages (~280 lines)
  • DW::TaskQueue::LocalDisk::receive() gains an optional wait_secs parameter (default 10) so
    process_fired_events can do non-blocking receives instead of busy-waiting on empty queues

Infrastructure changes:

  • Deleted 10 legacy worker scripts from bin/worker/ (the individual and mass variants of
    esn-fired-event, esn-cluster-subs, esn-filter-subs, esn-process-sub, and process-esn)
  • Removed 4 esn-legacy category entries from config/workers.json
  • Removed esn-legacy from CategoryOrder in dwtool's workers.go

Net: -682 lines, +39 lines.

All three ESN tests pass with the new drain implementation:

  • t/esn-end2end.t (12 assertions)
  • t/esn-journalnewcomment.t (50 assertions)
  • t/esn-duplicatesubscriptions.t (7 assertions)

CODE TOUR: This is a behind-the-scenes cleanup. Dreamwidth's Event-Subscription-Notification (ESN)
system — the thing that sends you emails and inbox notifications when someone comments on your
entry, etc. — used to have two parallel paths for processing events: an older one based on
TheSchwartz job queue, and a newer one based on SQS. We've been running 100% on the new path for a
while now, so this removes the old one entirely along with the 10 worker scripts that powered it.
Nothing changes from a user perspective; notifications keep working exactly as before.

🤖 Generated with Claude Code

zorkian and others added 3 commits February 15, 2026 13:20
$LJ::ESN_OVER_SQS has been 1 in production, meaning 100% of ESN events
route through DW::TaskQueue (SQS). The four legacy TheSchwartz-based ESN
workers are consuming no work. This removes the legacy path entirely so
ESN always uses the modern DW::Task::ESN::* pipeline.

- DW::TaskQueue dispatch() now unconditionally calls fire_task for events
- LJ::Event::fire_job() removed; process_fired_events() rewritten to
  drain DW::TaskQueue synchronously (used by tests)
- LJ::ESN: removed schwartz_capabilities(), process_fired_events(),
  jobs_of_unique_matching_subs(), and all four LJ::Worker::* packages
- Deleted 10 legacy worker scripts from bin/worker/
- Removed esn-legacy entries from workers.json and dwtool CategoryOrder
- LocalDisk::receive() gains optional wait_secs param (default 10) so
  process_fired_events can do non-blocking receives

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
schwartz_role was used by the legacy TheSchwartz ESN workers (removed in
the previous commit) to route certain event types to the mass job
database. No code calls these methods anymore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
These TheSchwartz tables were used by the mass ESN workers to process
high-volume events on a separate job database. No code reads from or
writes to them anymore — all ESN goes through DW::TaskQueue/SQS. The
tables will remain in existing databases until manually dropped.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zorkian zorkian force-pushed the remove-legacy-esn-workers branch from 713f6a8 to 91f9995 Compare February 15, 2026 21:21
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zorkian zorkian merged commit 655e10e into dreamwidth:main Feb 15, 2026
1 check passed
@zorkian zorkian deleted the remove-legacy-esn-workers branch February 15, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant