Repository navigation
fix(worker): connect to TEMPORAL_ADDRESS so the worker reaches Temporal in Docker - #6
Merged
Merged
Conversation
…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>
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(worker): connect to TEMPORAL_ADDRESS so the worker reaches Temporal in Docker
Bug (found by an actual
docker compose uprun):runTemporalWorkercalledWorker.createwithout a
connection, so it silently defaulted tolocalhost:7233and ignored theTEMPORAL_ADDRESS=temporal:7233that compose sets. The worker could never reach Temporal acrosscontainers and crashed at startup (
ConnectionRefused), with no retry — so no workflow/activity everran in Docker. Unit tests didn't catch it because they inject their own
nativeConnectionfrom thetest env; only a real multi-container run exercises this path.
Fix:
NativeConnectionatresolveTemporalAddress()(honorsTEMPORAL_ADDRESS,defaults to
localhost:7233).restart: on-failureto theworkerandserverservices so they ride out Temporal'sstartup race on a cold
docker compose up.Regression test:
worker.test.tsassertsresolveTemporalAddresshonorsTEMPORAL_ADDRESSanddefaults 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:7233and runs the full lifecycle.🤖 Generated with Claude Code