Problem
Every error out of fetch_blocks_via_rdma — including a purely local pinned-pool allocation failure (failed to allocate fetch chunk) — flows into the same error branch in rdma_fetch_task (pegaflow-core/src/backing/rdma_fetch.rs), which calls invalidate_connection(remote_addr) and forces a full re-handshake on the next fetch.
Under sustained pool pressure (LRU cannot carve the requested bytes) this becomes a loop: alloc fails → healthy connection destroyed → re-handshake → alloc fails again. The connection was never at fault.
Root cause
Errors are propagated as String, so the caller cannot distinguish "the RDMA connection is broken, invalidate it" from "this node is out of pinned memory, the connection is fine". This is the anti-pattern our own design constraint #3 (express state in types, not magic strings) warns about.
Suggested fix
Split the fetch error type into at least ConnectionError (invalidate + re-handshake) and LocalResourceError (keep the connection; fail or backoff the fetch). Only the former should reach invalidate_connection.
Context
Flagged during the #399 review (pre-existing; #399's chunk right-sizing made small-fetch alloc failures rarer but pool exhaustion still triggers this path).
🤖 Generated with Claude Code
Problem
Every error out of
fetch_blocks_via_rdma— including a purely local pinned-pool allocation failure (failed to allocate fetch chunk) — flows into the same error branch inrdma_fetch_task(pegaflow-core/src/backing/rdma_fetch.rs), which callsinvalidate_connection(remote_addr)and forces a full re-handshake on the next fetch.Under sustained pool pressure (LRU cannot carve the requested bytes) this becomes a loop: alloc fails → healthy connection destroyed → re-handshake → alloc fails again. The connection was never at fault.
Root cause
Errors are propagated as
String, so the caller cannot distinguish "the RDMA connection is broken, invalidate it" from "this node is out of pinned memory, the connection is fine". This is the anti-pattern our own design constraint #3 (express state in types, not magic strings) warns about.Suggested fix
Split the fetch error type into at least
ConnectionError(invalidate + re-handshake) andLocalResourceError(keep the connection; fail or backoff the fetch). Only the former should reachinvalidate_connection.Context
Flagged during the #399 review (pre-existing; #399's chunk right-sizing made small-fetch alloc failures rarer but pool exhaustion still triggers this path).
🤖 Generated with Claude Code