Conversation
This was referenced Sep 3, 2026
njskalski
force-pushed
the
timeout-local-materialize-inputs
branch
2 times, most recently
from
September 4, 2026 15:25
2fb59fe to
a836f99
Compare
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D118630354. (Because this pull request was imported automatically, there will not be any future comments.) |
`what-up` `dynamic analysis [local_materialize_inputs]` is DeferredPreparationStage / MaterializedArtifacts. On a cold buck-out with `--materializations=none`, that span waits on `ensure_materialized` of `go_list` JSON (`dynattrs.artifact_value`). The fetch is BatchReadBlobs or ByteStream Read with HTTP/2 keepalives but no per-RPC deadline, so a hung frontend can leave TCP ESTABLISHED while `ensure_materialized` never returns. Warm sqlite marks the path Materialized and skips the network, which is why this is cold-only. that share the same frontend address. This patch bounds only CAS/AC: - `tokio::time::timeout` around unary CAS/AC RPCs (default 60s) and ByteStream Read/Write start (default 600s) - `grpc-timeout` header on those requests for servers that honor it - `Execute` left unbounded - an expired deadline is retryable (existing 5-attempt retry), whether it arrives as `DeadlineExceeded` or as a `TimeoutExpired`-sourced `Cancelled` from the `grpc-timeout` header Knobs: `[buck2_re_client] grpc_timeout_secs` and `grpc_stream_timeout_secs` (`0` disables). This does not cover a stuck `buck2-dm` that never dequeues `Ensure` (no RPC is sent).
`ensure_materialized` waits forever on a oneshot until the single `buck2-dm` thread dequeues `MaterializerCommand::Ensure`. If that thread is stuck in sync sqlite/WAL or clean-stale, no CAS RPC is sent and the client RPC timeout cannot fire. Bound only that oneshot (default 60s). The download future returned after `Ensure` is accepted is already bounded by the CAS RPC timeout. The error is distinct (`Materializer did not accept Ensure`) so a stuck command thread is distinguishable from a hung `BatchReadBlobs`. `[buck2] materializer_ensure_timeout_secs = 0` disables.
njskalski
force-pushed
the
timeout-local-materialize-inputs
branch
from
October 4, 2026 17:18
a836f99 to
bc09fc3
Compare
This branch has not been deployed
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.
OSS CAS/AC RPCs and the
Ensureoneshot have no deadline. A hungBatchReadBlobsfreezesensure_materialized(dynamic analysis [local_materialize_inputs]) forever; keepalives leave TCP ESTABLISHED.Endpoint::timeoutwould also killExecuteon a shared frontend (#1221).Bound unary CAS/AC (60s), ByteStream open (600s), and the
Ensureoneshot (60s).Executeunbounded.DeadlineExceededis retryable.0ongrpc_timeout_secs/grpc_stream_timeout_secs/materializer_ensure_timeout_secsdisables.Seen on Buildbarn with
--materializations=none: timeout fires (client RPC timeout (60s) expired),buck2-dmidle inep_poll, build proceeds past the hang.