risingwavelabs/risingwave · error · StreamExecutorError

left barrier received while right stream end

Error message

left barrier received while right stream end

What it means

Mirror case of the right-side error: after the left input ended, the right stream delivered a Barrier. The barrier aligner cannot forward a barrier to a downstream that expects both sides aligned, so it errors out.

Source

Thrown at src/stream/src/executor/barrier_align.rs:102

                        }
                        Message::Chunk(chunk) => yield AlignedMessage::Right(chunk),
                        Message::Barrier(_) => {
                            bail!("right barrier received while left stream end");
                        }
                    }
                }
                break;
            }
            Either::Right((None, _)) => {
                // right stream end, passthrough left chunks
                while let Some(msg) = left.next().await {
                    match msg? {
                        Message::Watermark(watermark) => {
                            yield AlignedMessage::WatermarkLeft(watermark)
                        }
                        Message::Chunk(chunk) => yield AlignedMessage::Left(chunk),
                        Message::Barrier(_) => {
                            bail!("left barrier received while right stream end");
                        }
                    }
                }
                break;
            }
            Either::Left((Some(msg), _)) => match msg? {
                Message::Watermark(watermark) => yield AlignedMessage::WatermarkLeft(watermark),
                Message::Chunk(chunk) => yield AlignedMessage::Left(chunk),
                Message::Barrier(barrier) => loop {
                    let start_time = Instant::now();
                    // received left barrier, waiting for right barrier
                    match right
                        .next()
                        .instrument_await(await_tree::span!(
                            "barrier_align_wait_right epoch={}",
                            barrier.epoch.curr
                        ))
                        .await

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Make both barrier-producing upstreams terminate in lockstep (same barriers, same shutdown).
  2. Investigate why the left upstream ended early — usually an upstream failure visible in earlier logs.
  3. In tests, ensure both input streams contain barriers at the same positions.
Defensive patterns

Strategy: validation

Validate before calling

// ensure both test inputs end together
assert!(right_msgs.iter().rposition(|m| m.is_barrier()).unwrap_or(0) <= left_msgs.len());

Try / catch

match barrier_align(left, right).next().await { Some(Err(e)) if e.to_string().contains("left barrier received while right stream end") => { align_inputs(); } other => ... }

Prevention

When it happens

Trigger: The right input keeps producing barriers after the left input stream returned None, in `barrier_align` (exercised via `barrier_align_for_test`).

Common situations: Asymmetric upstream failure/shutdown on one side of a binary operator; test streams with mismatched message sequences; one upstream actor terminated early.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/195d7bd0b28686e6. Report an issue: GitHub.