Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error handling in case of udsink failures #2372

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rust/numaflow-core/src/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ impl SinkWriter {
// Discard the message from the tracker
this.tracker_handle.discard(offset).await?;
}
return Err(e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were we sending the wrong metrics during error because of this logical bug?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the case when udsink container goes down because of a panic. Numa was not getting restarted immediately instead it was getting restarted after the multiple health check failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encountered during testing of changes I'm making in this PR

}
}

Expand Down
9 changes: 4 additions & 5 deletions rust/numaflow-core/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use crate::metrics::{
pipeline_isb_metric_labels, pipeline_metrics,
};
use crate::tracker::TrackerHandle;
use crate::Result;
use crate::{
message::{Message, Offset},
reader::LagReader,
};
use crate::{Error, Result};
use numaflow_pulsar::source::PulsarSource;
use tokio::sync::OwnedSemaphorePermit;
use tokio::sync::Semaphore;
Expand Down Expand Up @@ -337,10 +337,9 @@ impl Source {

// write the messages to downstream.
for message in messages {
messages_tx
.send(message)
.await
.expect("send should not fail");
messages_tx.send(message).await.map_err(|e| {
Error::Source(format!("failed to send message downstream {:?}", e))
})?;
}
}
});
Expand Down
Loading