Skip to content

recv_when(false) does not detect pdata channel closure when buffer has messages #2315

@lalitb

Description

@lalitb

Pre-filing checklist

  • I searched existing issues and didn't find a duplicate

Component(s)

Rust OTAP dataflow (rust/otap-dataflow/)

Bug Description

recv_when(false) only checks if the pdata channel is closed when the buffer is empty (is_empty() == true). If the upstream sends messages and then shuts down, the channel is closed but has buffered messages. is_empty() returns false, the closure check is skipped, and recv_when blocks on the control channel waiting for a Shutdown that never arrives - because the engine only sends Shutdown via control to receivers, not to processors or exporters.

This means any node calling recv_when(false) can hang if the pdata channel closes while there are still buffered messages.

Known callers affected:

Steps to Reproduce

  1. Have a node that calls recv_when(false) for an extended period (e.g., Azure Monitor exporter during auth failure)
  2. Upstream sends a few pdata messages
  3. Upstream shuts down (drops its pdata sender)
  4. The node's pdata channel is now closed with buffered messages
  5. recv_when(false) never detects the closure - node hangs

Expected Behavior

recv_when(false) should detect pdata channel closure regardless of whether the buffer is empty, so the node can shut down cleanly.

Actual Behavior

recv_when(false) skips the closure check when the buffer is not empty, and the node hangs forever.

OTel-Arrow Version

latest

Environment

All env

Configuration

Log Output

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions