Helm installation remediation

Notes on the fixes that make the Helm chart usable in production. Each entry maps to a finding from the installation review; the corresponding PR is listed where relevant.

Login after install (was: impossible)

The app seeds an admin only from BOOTSTRAP_ADMIN_EMAIL + BOOTSTRAP_ADMIN_PASSWORD (db/seeds.rb), but the chart never emitted them — so after helm install there was no way to sign in (the demo admin is gated behind development? || SEED_DEMO). The chart now has:

admin:
  bootstrap:
    email: ""
    password: ""

Both vars are emitted only when both are set ({{- if and ... }}). Setting just the email would make the migration Job fail (ENV.fetch KeyError in the seed).

Chart values that were dead

TRINO_URL / TRINO_DEPLOYMENT

TRINO_URL was guarded by {{- if }} while TRINO_DEPLOYMENT was always emitted (even as ""), so a blank deployment made K8sClientFactory target an empty name. Both are now guarded by {{- if }} — absent when empty.

Superseded in round 2: guarding alone still let the chart install into a state that raises KeyError on the first “Run”. Both now carry conventional defaults and are enforced non-empty by values.schema.json.

Pod/container security

The migration Job (pre-install/pre-upgrade hook) got the container securityContext (runAsNonRoot, allowPrivilegeEscalation: false, drop: ALL, seccomp RuntimeDefault) so it survives a PSA-restricted namespace.

Kubernetes access from the app

SSL trust

SSL_CERT_FILE used to point only at the internal CA, which replaces the system trust bundle and breaks HTTPS to public endpoints (e.g. Slack webhooks). It is no longer set. INTERNAL_CA_FILE is consumed by HttpTransport as an explicit ca_file for catalog/Trino TLS, so the internal CA still works without poisoning the bundle.

Engine heartbeat / orphan reaping

TrinoDemand.reap_orphans! compared last_heartbeat_at < stale, which excluded NULL heartbeats. A running execution whose worker died before the first Trino poll stayed running forever (demand never drained, table lock never released). The reaping query now uses COALESCE(last_heartbeat_at, started_at), and the pending -> running transition stamps last_heartbeat_at.

RBAC

The Role granted get/list/create/update/patch on all secrets in the release namespace (including the app’s own Secret). It is now scoped: get/update/patch restricted to the materialized Secret via resourceNames, create kept in a separate unscoped rule, list dropped.

Superseded in round 2: the authorized name did not match the one the app wrote. The name now comes from a single helper and is handed to the app as TRINO_CATALOG_SECRET_NAME.

Maintenance step config

retention_threshold, file_size_threshold and snapshot_ids are interpolated into the ALTER TABLE ... EXECUTE statement. They are now validated at the model: thresholds must be a magnitude-plus-unit (7d, 128MB, 1.5GB) and snapshot_ids a comma-separated list of integers. The where clause remains free-form by design; plan edits are admin-only via Pundit.

Release pipeline

Round 2: regressions the first round introduced

Worker pods lost their securityContext

migration-job.yaml was fixed by applying .Values.securityContext, but the three worker Deployments still read their own worker*.securityContext, which defaults to {} — so {{- with }} skipped it and they rendered with no security context at all. Under Pod Security Admission restricted the Deployments are created but every pod is rejected, so helm status looks healthy while no job, schedule or freshness sweep ever runs. They now fall back to the top-level context: default .Values.securityContext .Values.worker.securityContext.

The RBAC scope authorized a name nothing wrote

The Role restricted get/update/patch to <fullname>-trino-catalog-secrets, but TrinoSecretMaterializer computed <HELM_RELEASE>-trino-catalog-secrets — and fullname is <release>-<chart>, so the two never matched. get_secret returned 403, which is Kubeclient::HttpError and not ResourceNotFoundError (kubeclient/common.rb only maps 404 to the latter), so the rescue that would have created the Secret never fired and the outer rescue swallowed it: credentials silently never materialized.

The name is now computed once, in lakedeepdiver.trinoSecretName, and used by both the Role’s resourceNames and the TRINO_CATALOG_SECRET_NAME env var the app reads. The app no longer derives it. The swallowing rescue logs at error with the namespace, name and HTTP status, and records an ErrorEvent.

Secrets were rendered into a ConfigMap

OIDC_CLIENT_SECRET and BOOTSTRAP_ADMIN_PASSWORD were emitted into the ConfigMap — readable by anyone with get configmap in the namespace and kept in the Helm release. They moved to a <fullname>-chart-env Secret, mounted by every workload through the shared lakedeepdiver.envFrom helper.

Every pod, not just web: config/initializers/devise.rb runs ENV.fetch on the OIDC vars in every process, so a worker without OIDC_CLIENT_SECRET while SSO_ENABLED=true is a boot-time KeyError.

prod.yaml pinned a stale image tag

infra/helm/values/prod.yaml was on 0.1.7 while the chart was 0.2.1, because the x-release-please-version marker lived only in values.yaml and Chart.yaml. Installing with prod.yaml therefore shipped an image predating SKIP_DB_PREPARE (0.1.8), reintroducing the web-pod migration race the chart believed it had fixed — and dropping the step-config validation and the cross-database retry with it. The file is now a release-please extra-file and carries the marker, as does the artifacthub.io/images annotation.

The credentials Secret went to the wrong namespace

The cross-namespace Role exists so the app can materialize the Secret where Trino runs, but the app wrote to K8S_NAMESPACE (its own pod’s namespace). It now prefers TRINO_NAMESPACE and falls back to K8S_NAMESPACE.

Round 2: fixes that had not gone far enough

The cross-database retry leaked a different way

retry_pending gave up after MAX_RETRIES and left the execution pending forever. pending counts as demand, reap_orphans! only looked at running, and EngineWatchdogJob only watches the engine row — so the engine never drained and run_plan‘s already-queued guard blocked that table permanently.

Two changes: the job now fails the execution explicitly through ExecutionFailureHandler and signals demand_finished!; and TrinoDemand.reap_orphans! also reaps executions left pending past TRINO_PENDING_STALE_MINUTES (default 45, comfortably above READY_TIMEOUT * MAX_START_ATTEMPTS), covering the case where the dispatch never arrived at all.

ExecutionHistory#retry_count is now cleared once the dispatch is visible; otherwise a healthy execution rendered as “retrying” for the rest of its chain.

Blank TRINO_URL / TRINO_DEPLOYMENT installed happily

Guarding both with {{- if }} stopped the empty-string bug but produced a chart that installs into a state that raises KeyError on the first “Run”, with nothing to catch it — values.schema.json had no env block at all. They now default to the conventional in-cluster names and are enforced non-empty by the schema, which also requires the OIDC quartet together and the bootstrap admin email/password as a pair.

Kubeclient errors bypassed the engine retry

ChartTrinoProvisioner let Kubeclient errors escape, but SuperviseEngineStartJob only rescues TrinoProvisioner::Error and Timeout::Error and ApplicationJob has no generic retry — so a missing Deployment or a 403 killed the job, skipped MAX_START_ATTEMPTS, and left the engine in starting until the watchdog failed it minutes later. They are now wrapped as TrinoProvisioner::Error with the addressed namespace/deployment in the message. A worker Deployment absent on destroy! is tolerated, since single topology legitimately has none.

env.trinoWorkerDeployment is now a chart value; the default engine topology is cluster, so the worker Deployment name was previously unreachable from the chart.

Still open / verify under load

Round 3: application-level findings

Found while reviewing the code the earlier rounds had not covered (catalog sync, freshness, retention, authorization).

A failed sync deactivated tables that still exist

CatalogSyncService rescues per table and per namespace, so a table whose sync raised never reached seen - and deactivate_unseen then marked it “dropped from the catalog”. A namespace that failed to list took all of its tables with it, and with every namespace failing seen was empty, where where.not(id: []) renders as 1=1 and deactivated the entire catalog.

Deactivation is a real signal - it hides the table from the tables screen, from freshness sweeps (which filter on active) and from maintenance dispatch - so a transient catalog error silenced monitoring until the next successful sync, six hours by default, with only a warn log.

It is now restricted to namespaces that synced with no errors at all.

Retention deleted open errors that were still happening

DataRetentionJob pruned ErrorEvent by created_at, but ErrorEvent.record dedupes by message: a recurring failure keeps its original created_at and only bumps last_seen_at. An open error first seen 100 days ago and last seen an hour ago was deleted by the nightly job. The schema’s [status, last_seen_at] index already pointed at the right column. Pruning is per-model now, with error_events keyed on last_seen_at.

The OAuth token’s real expiry was discarded

CatalogTokenProvider wrapped request_token in Rails.cache.fetch(..., expires_in: 5.minutes). fetch writes the block’s result itself, with the TTL given to fetch, so the expires_in the provider returned was always thrown away and a token valid for less than five minutes was served after it expired. It self-healed through the retry-once on 401 in CatalogClient#get, so the cost was a wasted round-trip rather than a failed sync. An explicit read/write pair now honours the response’s expires_in, keeping the conservative TTL only as the fallback for providers that omit it.

Freshness probes left queries running on the coordinator

TrinoClient#query_scalar returned as soon as it had enough rows, abandoning an outstanding nextUri. Trino keeps such a query alive until its client timeout, so ChartTrinoProvisioner#idle? reported the engine busy and every sweep held it up for the whole drain grace period, logging “Drain grace period exhausted with queries still active” with no real query behind it. The client now DELETEs the outstanding nextUri, best effort.

The engine state machine’s compare-and-set did not compare

TrinoEngineSupervisor.transition! raised a “CAS lost” error that was unreachable: its UPDATE matched on id alone, so it always affected one row. The row lock in the callers was carrying the entire guarantee. The generation predicate is now part of the UPDATE, which also makes a transition from a stale record - the watchdog re-reads state outside the lock - fail loudly instead of overwriting a concurrent transition.

A forgotten authorize was indistinguishable from an intentional one

Pundit’s verify_authorized was not enabled, so an action without authorize simply ran for any signed-in user. An audit of all sixteen controllers found no actual hole: the two actions without authorize (ProfilesController, ThemeController#toggle) operate only on current_user, take no id parameter, and exclude role/status from strong params. verify_authorized is now on globally, with those two opting out explicitly so the decision is visible.

verify_policy_scoped is deliberately not enabled: index actions here authorize the class rather than scoping a relation.

Smaller

Checked and found correct

Recorded so they are not re-investigated: FreshnessProbe quotes both identifiers and literals, and partition_lookback is validated positive with a DB default; CatalogClient#get retries exactly once on 401, because Ruby runs ensure after retry rather than before, so there is no loop; suspension is enforced per request by Devise’s activatable hook through active_for_authentication?, including OIDC sessions; and delete_all does honour limit, via a subquery on the primary key.

Observability: Prometheus metrics and structured logging

The chart does not create the PodMonitor (or the log collector): those are owned by the cluster/platform team, out of this repo. What the chart does is expose a scrapeable /metrics endpoint and structured JSON logs to STDOUT.

Metrics

The web pod serves Prometheus metrics at GET <metrics.path> (default /metrics) on port 80 — the same listener that serves the app, so there is no extra port to open. The endpoint is a bare ActionController::Metal, open (no auth) because the in-cluster PodMonitor cannot authenticate.

Application metrics are always on and derived from the database at scrape time (PrometheusMetrics.refresh!), because only the web pod is scraped and any counter a worker incremented in-process would be invisible:

Service metrics (lakedeepdiver_http_requests_total, http_request_duration, sql_queries_total, sql_query_duration, process_cpu, process_resident_memory) are opt-in via metrics.serviceMetrics: true.

A PodMonitor for it looks like:

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: lakedeepdiver
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: lakedeepdiver
      app.kubernetes.io/component: web
  podMetricsEndpoints:
    - port: http          # or 80
      path: /metrics

The pod also carries prometheus.io/scrape/port/path annotations for clusters still using annotation-based discovery.

Logging

Structured JSON logging is provided by semantic_logger + rails_semantic_logger, replacing the previous TaggedLogging STDOUT logger. config/environments/production.rb declares a single appender — JSON to $stdout — so the platform’s log collector (Promtail/Alloy → Loki, or Fluent Bit → Logstash) parses every field. logging.format: text switches back to human-readable lines via LOG_FORMAT. Because the appender is declared in the Rails environment config, web, all three workers and the migration Job emit the same shape.

Round 3: installation review (bugs and extensibility gaps)

Findings from an install attempt against a real cluster. Several suggested fixes in the original review were wrong for this codebase and are rejected below with the evidence; the rest are applied.

Ingress backend port was hardcoded

templates/ingress.yaml pointed the backend at a literal number: 80 regardless of service.port. Setting service.port: 8080 (e.g. to sit behind a proxy that already terminates elsewhere) rendered clean and only failed as a 503/Connection refused at the load balancer. Now number: {{ .Values.service.port }}.

Default image did not resolve, and there was no way to use a private registry

image.repository defaulted to lakedeepdiver (no registry host); the image that is actually published is ghcr.io/maltzsama/lakedeepdiver (see the artifacthub.io/images annotation in Chart.yaml). A plain helm template with no overrides therefore rendered an image that does not resolve. The default is now ghcr.io/maltzsama/lakedeepdiver. Also added imagePullSecrets (values.yaml, consumed by all 4 workloads) — there was previously no way to pull from a private mirror without forking the chart.

worker.enabled / workerFreshness.enabled / workerEngine.enabled were dead

The three flags existed in values.yaml but no template guarded on them —setting any to false still rendered the Deployment. Each worker-*-deployment.yaml is now wrapped in {{- if .Values.<key>.enabled }}.

Worker rollouts could run two engine supervisors at once

No worker Deployment set spec.strategy. config/queue-engine.yml runs the engine supervisor with threads: 1, and SuperviseEngineStartJob holds no lock around the start/drain/watchdog sequence (only DrainEngineJob and EngineWatchdogJob use with_lock). With the Kubernetes default RollingUpdate, a helm upgrade could surge a second worker-engine pod before the old one terminates — two supervisors racing the same Trino engine. All three workers now set:

strategy:
  type: RollingUpdate
  rollingUpdate: { maxSurge: 0, maxUnavailable: 1 }

web is unchanged (stateless, tolerates the default). No PodDisruptionBudget was added: with replicaCount: 1 a PDB would only block node drains.

checksum/config did not cover chart-rendered Secrets

Pod templates only hashed configmap.yaml. A helm upgrade --set oidc.clientSecret=... (or any change materializing/altering secret-chart-env.yaml or secret-app.yaml) changed the Secret’s content without changing any annotation the Deployment watches, so Kubernetes saw no diff and did not roll the pods — they kept running with the old value in envFrom until recycled for an unrelated reason. A new lakedeepdiver.podAnnotations helper (_helpers.tpl) adds checksum/secrets (guarded so an all-empty render does not hash to a constant), used by every Deployment. Scope: this only covers Secrets the chart itself renders. Rotating the out-of-band appSecrets.existingSecret still does not trigger a rollout — the chart never sees its contents to hash them.

RBAC granted Deployment-patch rights even when nothing used them — fixed differently than proposed

The original suggestion was to wrap all of rbac.yaml in {{- if eq .Values.trino.provisioner "chart" }}. That would have been wrong: lakedeepdiver.trinoRules bundled two independent grants — rights over the materialized catalog-credentials Secret (used by TrinoSecretMaterializer, called from CatalogSyncService regardless of the provisioner) and rights to patch/scale the Trino Deployment (used by ChartTrinoProvisioner, which BaleiaTrinoProvisioner inherits from and only overrides create!). Gating on "chart" would have broken catalog sync under baleia/fake and left baleia unable to scale the engine it still manages via inheritance. The rules are now split into lakedeepdiver.trinoSecretRules (always granted) and lakedeepdiver.trinoDeploymentRules (granted whenever trino.provisioner != "fake", which covers chart and baleia).

No customization hooks

Nothing in templates/ read extraEnv, extraVolumes, extraVolumeMounts, podAnnotations or podLabels — any need outside what the chart models (mount a cert, add a scrape override, inject a sidecar env var) required a fork. All five are now plumbed through every workload (extraEnv also on the migration Job).

serviceaccount.yaml had no annotations hook

Cloud IAM federation (eks.amazonaws.com/role-arn, iam.gke.io/gcp-service-account) attaches via a ServiceAccount annotation; there was no value for it. Added serviceAccount.annotations (default {}).

automountServiceAccountToken was not configurable — fixed differently than proposed

The original suggestion was automountServiceAccountToken: false on the web Deployment. That is wrong here: TrinoEngineConfigsController#apply_to_running_cluster! calls TrinoProvisioner.adapter.send(:apply_coordinator_spec) directly from the web process, which patches the Trino Deployment via the k8s API — web needs the token. automountServiceAccountToken is now a value (default true) applied to web and all three workers; it is hardcoded false only on the migration Job, since db:prepare/db/seeds.rb never call the k8s API.

Dead postgresql value

postgresql.existingSecret/urlKey were required in values.schema.json but consumed by no template — the app reads DATABASE_URL from appSecrets.existingSecret. Removed from values.yaml, values.schema.json and infra/helm/values/prod.yaml in one change (the root schema keeps additionalProperties: true, so a leftover postgresql: key in an existing values file still validates harmlessly).

Dead env.jobConcurrency value

Never emitted to the ConfigMap (concurrency comes from config/queue-*.yml; see “Chart values that were dead” above), but the value itself was never removed from values.yaml/prod.yaml, so it looked configurable. Dropped.

values.yaml‘s header comment named a specific consumer layout

# Overrides live in infra/helm/values/*.yaml is this repo’s own convention, not something a chart distributed to third parties should assert in the file helm show values prints. Reworded to be consumer-agnostic.

The new podAnnotations hook collided with the hardcoded metrics annotations

The extraEnv/podAnnotations extension hooks above landed with a bug: on deployment-web.yaml, podAnnotations was rendered as its own block alongside the hardcoded prometheus.io/scrape/port/path annotations (only emitted when metrics.enabled). An operator using the new hook for its obvious purpose — disabling scraping for one release via podAnnotations: {prometheus.io/scrape: "false"} — got a Deployment with the same annotation key emitted twice. helm template/helm lint render and pass this without complaint; most YAML parsers then silently resolve duplicate keys to “whichever came last” (here, the hardcoded "true"), so the override has no effect and nothing signals why. lakedeepdiver.podAnnotations (_helpers.tpl) now takes an optional extra dict of caller-specific annotations (used only by web, for the Prometheus ones) and builds one merged map —.Values.podAnnotations taking precedence over extra and the computed checksums — rendered with a single toYaml. Also gave the migration Job’s pod template a checksum/config annotation, since podAnnotations/podLabels are documented as applying to every workload but the Job’s pod template had no annotations: block at all to merge into.

Rejected

Round 4: install-blocking bugs in the published image and manifests

Findings from another install review. Verified each against the current chart before fixing; two items from the review no longer applied (the Ingress port was already templated by round 3, and a suggested kubeVersion field was polish, not a bug).

pgrep did not exist in the published image

The three worker Deployments’ livenessProbe (lakedeepdiver.workerDeployment in _helpers.tpl) runs pgrep -f solid_queue, but Dockerfile‘s runtime stage installed only curl libjemalloc2 imagemagick sqlite3 on top of ruby:4.0.6-slim — a Debian slim image ships without procps (the package that provides pgrep). Every worker pod, on any install using the published ghcr.io/maltzsama/lakedeepdiver image, hit “executable file not found” on the first liveness check and CrashLoopBackOffed roughly 75s after boot (initialDelaySeconds: 30 + 3 × periodSeconds: 15). Added procps to the apt-get install line in the base stage.

The migration Job’s pod could receive traffic from the web Service

migration-job.yaml‘s pod template used lakedeepdiver.webSelector for its labels — the exact selector service.yaml uses for the web Service. The Job has no readinessProbe (it runs db:prepare once and exits), so its pod becomes Ready the instant the container starts; matching the web selector meant the Service could route live HTTP traffic to a pod that never serves HTTP, causing a transient 502/timeout window on every helm install/upgrade, not just on failure. Added a dedicated lakedeepdiver.migrateSelector (component: migrate) so the Job’s pod is never selected by the web Service.

No startupProbe on web or the workers

deployment-web.yaml only had livenessProbe/readinessProbe (liveness budget ~65s: initialDelaySeconds: 20 + 3 × periodSeconds: 15); the worker helper only had livenessProbe (~75s budget). A slow cold boot (large migration backlog, cold cache, a busy node) past that window caused a liveness-triggered restart mid-startup instead of just taking longer to become ready. Added a startupProbe to both (web: httpGet /up; workers: the same pgrep exec check, now that procps is installed), each with periodSeconds: 5 / failureThreshold: 30 (~150s of startup grace) — initialDelaySeconds was dropped from the liveness/readiness probes since Kubernetes does not evaluate them until the startup probe first succeeds, so the delay was redundant once a startup probe exists.

internalCA.mountFile default clobbered the system CA bundle

internalCA.mountFile defaulted to /etc/ssl/certs/internal-ca.crt. Every workload mounts the volume at dir .Values.internalCA.mountFile — /etc/ssl/certs, the Debian system CA bundle directory. The Secret behind that mount has a single key (internal-ca.crt), so mounting it there replaces the entire directory contents, hiding ca-certificates.crt and every other system cert the moment internalCA.enabled + existingSecret are set. That is the exact failure the “SSL trust” section (round 1) already fixed once for SSL_CERT_FILE (INTERNAL_CA_FILE was introduced specifically to avoid replacing the system bundle) — the default mount path silently reintroduced the same class of bug from the other direction. Changed the default to /etc/lakedeepdiver/certs/internal-ca.crt, a dedicated directory with no overlap. infra/helm/values/prod.yaml updated to match.

Schema gaps let typos and bad types through silently

worker, workerFreshness, workerEngine, service and ingress had no values.schema.json coverage at all (only metrics/logging, among the keys without dedicated Helm templates already, had any). Added properties for all five (types matching their existing defaults). This catches a bad value under a correctly-spelled key (e.g. worker.enabled: "yes") but, by design, not a misspelled top-level key like workerFrehsness: {...} — the schema root keeps additionalProperties: true (unchanged, see round 1) so an operator’s own extra values keys keep working. Tightening that further is a bigger, separate decision.

Fail-fast for empty secrets was attempted and reverted

The review flagged that activeRecordEncryption.existingSecret: "" and an unconfigured appSecrets both pass schema validation and only fail at runtime with a hard-to-trace error. Adding minLength: 1 to activeRecordEncryption.existingSecret and an anyOf requiring appSecrets.create: true or a non-empty existingSecret both broke helm lint/helm template against the chart’s own unmodified values.yaml — this chart’s CI (ci.yml‘s chart job) renders and validates the defaults with no values file, and both fields default to empty. Reverted; noted here so it is not re-attempted the same way. A real fix needs either a non-empty conventional default (not viable for a secret name) or accepting that this chart’s schema cannot make these two fields required without breaking the no-overrides render path.

resources: {} on web, inconsistent with every worker

worker, workerFreshness and workerEngine all ship default requests/limits; web — the only workload that serves traffic — had none. Added requests: {cpu: 200m, memory: 512Mi}, limits: {cpu: 1000m, memory: 1Gi}.

migrationJob ignored nodeSelector/tolerations/affinity

Every other workload (web, the three workers) reads these three values; the migration Job read none of them. On a cluster with tainted/dedicated node pools, the pre-install/pre-upgrade hook would never get scheduled, hanging the entire helm upgrade on a Job that can’t run. Added the same three {{- with .Values.* }} blocks already used elsewhere.

kubeVersion added to Chart.yaml

kubeVersion: ">=1.25.0" — recommended by ArtifactHub, no functional effect (every API used, including deployments/scale, predates that version by a wide margin).

Out of scope (deliberate)

Round 5: a real readinessProbe for the workers

Follow-up review of round 4 confirmed items 5 and 6 were resolved (RBAC’s Deployment-patch rules now gated on trino.provisioner != "fake"; worker rollouts now use maxSurge: 0/maxUnavailable: 1) and flagged item 7 - no readinessProbe on the workers - as still open: round 4 added a startupProbe, but it only gates when liveness/readiness are first evaluated, it does not add a “ready to process the queue” signal that was missing independent of boot time.

The workers had no real readiness signal, only pgrep

pgrep -f solid_queue (the existing livenessProbe, and round 4’s startupProbe) only proves the process exists in the container - it says nothing about whether it ever reached a working state. A worker that boots but can never reach Postgres would pgrep clean forever while doing nothing. Verified this empirically: built the image, ran bin/jobs against a real Postgres container, confirmed SolidQueue::Process rows get written with a live heartbeat; then stopped Postgres under a running worker and confirmed pgrep -f solid_queue still exited 0 while the process was in fact unable to do anything.

Added a readinessProbe (lakedeepdiver.workerDeployment in _helpers.tpl) that queries the database instead of the process table:

exit(SolidQueue::Process.where(hostname: Socket.gethostname).where("last_heartbeat_at > ?", SolidQueue.process_alive_threshold.ago).exists? ? 0 : 1)

Socket.gethostname inside a pod resolves to the pod name, matching what Solid Queue itself records as hostname when a process registers - so this checks specifically for this pod’s own process, not just any worker anywhere. SolidQueue.process_alive_threshold (5 minutes by default) is the same tolerance Solid Queue’s own process-pruning logic uses to consider a process alive, rather than an invented value. Verified against the same live container: the check exits 0 (~0.8s) when Postgres is reachable and Solid Queue is registered, and exits non-zero within a couple seconds when Postgres is unreachable - the exact failure mode this item was about.