Skip to content

fix(host): do not attach acquire to a stopped autopg port - #36

Open
simoncrypta wants to merge 1 commit into
mainfrom
fix/acquire-dead-host
Open

fix(host): do not attach acquire to a stopped autopg port#36
simoncrypta wants to merge 1 commit into
mainfrom
fix/acquire-dead-host

Conversation

@simoncrypta

Copy link
Copy Markdown
Collaborator

Summary

  • cedarpg acquire --force no longer treats a registered-but-stopped autopg (pm2 status: stopped, port 25432) as live, which produced ECONNREFUSED 127.0.0.1:25432.
  • Attach requires TCP on the discovered port. Ephemeral start is detached autopg postmaster only (no install --no-pm2, so ~/.autopg/admin.json is left alone).
  • Default local acquire: try autopg install, then an owned postmaster on 55432 if install fails or still has no listener. CEDAR_PG_EPHEMERAL_HOST=0 keeps the fail-closed pm2 path.

Test plan

  • vp check and vp test (86)
  • cedarpg acquire --force with autopg stopped, no CI / CEDAR_PG_EPHEMERAL_HOST → URL on 55432, not 25432
  • CEDAR_PG_EPHEMERAL_HOST=0 still fails and does not start 55432
  • vp run smoke:pg (Vitest, Jest, CLI acquire/run/dispose)
  • ~/.autopg/admin.json unchanged next to local pm2

Registered pm2 with no listener was treated as live, so cedarpg acquire
hit ECONNREFUSED on 25432. Treat status/TCP as liveness and start an
owned postmaster when local install cannot bring a host up.
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f88e10ac-3928-472c-bc37-cd8068928768


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant