Skip to content

Conversation

cstockton
Copy link
Contributor

Add stronger ordering and dependency constraints to reduce startup race conditions and noisy flapping:

  • Wait for cloud-init, supabase-admin-agent_salt, apparmor, systemd-sysctl, and ufw` to complete before starting.
  • Require network-online.target and systemd-resolved for stable DNS resolution; note Go's resolver can race with early boot DNS.
  • Ensure postgresql.service is online before starting auth to avoid misleading error noise during slow boots.
  • Lower StartLimitIntervalSec and StartLimitBurst to reduce repeated restarts in failure scenarios.
  • Switch service type to exec instead of simple. This removes the tiny window in which systemd is supervising the wrapper process instead of the Go binary.

These changes aim to rule out capability changes, socket reuse races, and incomplete firewall/network config as causes of EADDRINUSE errors and unstable startup.

@cstockton cstockton requested review from a team as code owners September 8, 2025 17:14
Chris Stockton and others added 4 commits September 16, 2025 14:21
Add stronger ordering and dependency constraints to reduce startup race
conditions and noisy flapping:

- Wait for `cloud-init`, `supabase-admin-agent_salt`, `apparmor`,
  `systemd-sysctl`, and `ufw` to complete before starting.
- Require `network-online.target` and `systemd-resolved` for stable DNS
  resolution; note Go's resolver can race with early boot DNS.
- Ensure `postgresql.service` is online before starting auth to avoid
  misleading error noise during slow boots.
- Lower `StartLimitIntervalSec` and `StartLimitBurst` to reduce
  repeated restarts in failure scenarios.
- Switch service type to `exec` instead of `simple`. This removes the tiny
  window in which systemd is supervising the wrapper process instead of the
  Go binary.

These changes aim to rule out capability changes, socket reuse races, and
incomplete firewall/network config as causes of EADDRINUSE errors and
unstable startup.
@cstockton cstockton merged commit 493bd39 into develop Sep 17, 2025
14 checks passed
@cstockton cstockton deleted the cs/systemd-update branch September 17, 2025 14:48
cstockton added a commit that referenced this pull request Sep 17, 2025
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.

4 participants