Skip to content
Merged
Changes from all commits
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
21 changes: 14 additions & 7 deletions crates/adapters/src/controller/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,13 +1257,20 @@ impl ControllerStatus {
/// True if the pipeline has processed all inputs to completion.
pub fn pipeline_complete(&self) -> bool {
// All input endpoints (if any) are at end of input.
if !self
.input_status()
.values()
.filter(|endpoint_stats| !endpoint_stats.endpoint_name.contains(".api-ingress-"))
.all(|endpoint_stats| endpoint_stats.is_eoi())
{
return false;
for ep in self.input_status().values().filter(|ep| !ep.is_eoi()) {
let name = &ep.endpoint_name;

// We don't require HTTP ingress connectors to be at end of input,
// because the user is in charge of whether more data comes in.
//
// We also don't require the clock connector to be at end of input
// if it's configured to advance only when the user sends a request.
let ignore = name.contains(".api-ingress-")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couldn't this be a trait method on the endpoint?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, it could and arguably should. I think I'll leave that refactoring for the next time we have to touch this code.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The string "now" is a magic value identifying the clock endpoint. If this name is defined elsewhere as a constant, it would be safer to reference that constant here. If it isn't, consider extracting it as one — a rename of the clock endpoint would silently break this check.

|| (name == "now" && self.pipeline_config.global.dev_tweaks.now_http_driven());

if !ignore {
return false;
}
}

// All received records have been processed by the circuit.
Expand Down
Loading