Skip to content

RDMA fetch tears down a healthy connection on local allocation failure #401

Description

@xiaguan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions