Skip to content

Add gRPC connect timeouts, prevent global locking of job_state - #1115

Closed
cmackenzie1 wants to merge 5 commits into
masterfrom
cole/controller-fixes
Closed

Add gRPC connect timeouts, prevent global locking of job_state#1115
cmackenzie1 wants to merge 5 commits into
masterfrom
cole/controller-fixes

Conversation

@cmackenzie1

@cmackenzie1 cmackenzie1 commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Recovered jobs could stop immediately after logging that their state
machine had started. A stale worker address left tonic's connection
future pending forever because it had no connection deadline.

Apply a 10-second timeout to each attempt while retaining the existing
retry and recovery behavior. Exhausted attempts now let the state machine
handle the unavailable leader instead of remaining stuck before its first
state executes.
A full state-machine queue caused controller RPC handlers to wait while
holding the global job map mutex. One stalled job could therefore prevent
messages from reaching every other job.

Clone the selected job's sender under the map lock, then release the lock
before waiting for channel capacity. This preserves per-job backpressure
without making it controller-wide.
The recovered-leader fix bounded only one connection path, while other
controller and worker clients could still wait indefinitely for tonic to
establish a transport connection.

Add a global `grpc.connect-timeout` setting with a 10-second default and
apply it to every endpoint produced by `grpc_channel_builder`. Remove the
leader-specific wrapper while retaining its retry policy, and cover both
the default and environment override configuration.
@cmackenzie1
cmackenzie1 requested review from QnJ1c2kNCg and mwylde July 28, 2026 21:33

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Comment thread crates/arroyo-rpc/src/config.rs Outdated
Comment thread crates/arroyo-rpc/src/config.rs
Comment thread crates/arroyo-rpc/src/config.rs Outdated
Comment thread crates/arroyo-rpc/default.toml Outdated
Comment thread crates/arroyo-controller/src/lib.rs
The global gRPC connection timeout affected every Arroyo service and RPC
client even though the observed stall occurs while reconnecting a recovered
job to its worker leader.

Remove the global configuration and endpoint behavior. Restore the
10-second deadline around each leader connection attempt while preserving
the existing retry and recovery behavior.
@cmackenzie1 cmackenzie1 self-assigned this Jul 28, 2026
Comment thread crates/arroyo-controller/src/job_controller/leader_manager.rs Outdated
A mandatory global timeout changed connection behavior for every service,
while a leader-only fallback prevented deployments from choosing tonic's
unbounded default.

Add an optional global `grpc.connect-timeout` setting that defaults to
unset and apply it when building endpoints. Remove the leader-specific
fallback so all clients consistently follow the configured policy.
@cmackenzie1

Copy link
Copy Markdown
Collaborator Author

Replaced with #1117 #1118

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.

2 participants