Skip to content

Commit 0e93998

Browse files
authored
fix: avoid panic when upstream input is closed for lookup (risingwavelabs#8529)
1 parent 338ace9 commit 0e93998

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/stream/src/executor/lookup/sides.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use anyhow::Context;
1516
use either::Either;
1617
use futures::stream::PollNext;
1718
use futures::StreamExt;
@@ -247,7 +248,7 @@ pub async fn stream_lookup_arrange_prev_epoch(
247248
match input
248249
.next()
249250
.await
250-
.expect("unexpected close of barrier aligner")?
251+
.context("unexpected close of barrier aligner")??
251252
{
252253
Either::Left(Message::Watermark(_)) => {
253254
todo!("https://github.com/risingwavelabs/risingwave/issues/6042")
@@ -298,7 +299,7 @@ pub async fn stream_lookup_arrange_this_epoch(
298299
match input
299300
.next()
300301
.await
301-
.expect("unexpected close of barrier aligner")?
302+
.context("unexpected close of barrier aligner")??
302303
{
303304
Either::Left(Message::Chunk(msg)) => {
304305
// Should wait until arrangement from this epoch is available.
@@ -333,7 +334,7 @@ pub async fn stream_lookup_arrange_this_epoch(
333334
match input
334335
.next()
335336
.await
336-
.expect("unexpected close of barrier aligner")?
337+
.context("unexpected close of barrier aligner")??
337338
{
338339
Either::Left(Message::Chunk(msg)) => yield ArrangeMessage::Stream(msg),
339340
Either::Left(Message::Barrier(b)) => {
@@ -355,7 +356,7 @@ pub async fn stream_lookup_arrange_this_epoch(
355356
match input
356357
.next()
357358
.await
358-
.expect("unexpected close of barrier aligner")?
359+
.context("unexpected close of barrier aligner")??
359360
{
360361
Either::Left(_) => unreachable!(),
361362
Either::Right(Message::Chunk(chunk)) => {

0 commit comments

Comments
 (0)