Skip to content

fix(worker): connect to TEMPORAL_ADDRESS so the worker reaches Temporal in Docker - #6

Merged
tobyvee merged 1 commit into
mainfrom
fix/worker-temporal-connection
Jun 27, 2026
Merged

tobyvee merged 1 commit into
mainfrom
fix/worker-temporal-connection

Conversation

@tobyvee

@tobyvee tobyvee commented Jun 27, 2026

Copy link
Copy Markdown
Owner

fix(worker): connect to TEMPORAL_ADDRESS so the worker reaches Temporal in Docker

Bug (found by an actual docker compose up run): runTemporalWorker called Worker.create
without a connection, so it silently defaulted to localhost:7233 and ignored the
TEMPORAL_ADDRESS=temporal:7233 that compose sets. The worker could never reach Temporal across
containers and crashed at startup (ConnectionRefused), with no retry — so no workflow/activity ever
ran in Docker. Unit tests didn't catch it because they inject their own nativeConnection from the
test env; only a real multi-container run exercises this path.

Fix:

  • The worker now opens a NativeConnection at resolveTemporalAddress() (honors TEMPORAL_ADDRESS,
    defaults to localhost:7233).
  • Added restart: on-failure to the worker and server services so they ride out Temporal's
    startup race on a cold docker compose up.

Regression test: worker.test.ts asserts resolveTemporalAddress honors TEMPORAL_ADDRESS and
defaults correctly — guarding against the "ignores the env var" regression.

Verified: typecheck · lint · worker test green. Confirmed live — after this fix the worker logs
polling task queue "engineering" @ temporal:7233 and runs the full lifecycle.

🤖 Generated with Claude Code

…al in Docker

Worker.create defaulted to localhost:7233 and ignored TEMPORAL_ADDRESS, so the worker crashed on startup in Docker (connection refused) and no workflows ran. Now opens a NativeConnection at resolveTemporalAddress(); added restart: on-failure to worker+server for the Temporal startup race; regression test for the address resolution.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tobyvee
tobyvee merged commit 3ab48bc into main Jun 27, 2026
1 check passed
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