Exception: Pgbus::Process::ReplicaConnectionError

Inherits:
Error
  • Object
show all
Defined in:
lib/pgbus.rb

Overview

A LISTEN connection landed on a read-only replica (pg_is_in_recovery() => t). After a failover, stale DNS can point a fresh connection at the demoted master; NOTIFY fires only on the primary, so such a connection connects "successfully" but never wakes. Raised by Process::PrimaryValidator so the listener rejects it and retries with backoff (re-resolving DNS each attempt).

Defined here rather than in process/primary_validator.rb because Zeitwerk requires each managed file to define exactly the constant matching its path — a second class in that file would break eager_load. lib/pgbus.rb is the (require-loaded) gem entry point, so it can define the error and explicitly namespace Process without conflicting with Zeitwerk's management of the lib/pgbus/process/ directory.