Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions crates/adapters/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,7 @@ impl CircuitThread {
};
let _ = init_status_sender.send(Ok(self.controller.clone()));

let mut output_backpressure_warning = None;
loop {
// Run received commands. Commands can initiate checkpoint
// requests, so attempt to execute those afterward. Executing a
Expand All @@ -1828,10 +1829,18 @@ impl CircuitThread {
// become available.
if self.controller.output_buffers_full() {
debug!("circuit thread: park waiting for output buffer space");
self.parker.park();
debug!("circuit thread: unparked");
let warning = output_backpressure_warning
.get_or_insert_with(|| LongOperationWarning::new(Duration::from_secs(1)));
warning.check(|elapsed| {
info!(
"pipeline stalled {} seconds because output buffers are full",
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.

To make the error message more actionable, would it be possible to add some more user feedback like:

"pipeline stalled {} seconds because output buffers from connector {connector-name} are full (observed output throughput is {} records/second). Pleases tune the output connector or downstream data destination for higher throughputs."

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, this is absolutely possible, and it would be a better message than what I added. But it would also take me the rest of the day to do, instead of an hour this morning. It's a compromise between insight and implementation time.

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.

Maybe merge this and add an issue (possibly even a meta issue) that collects instances like this.

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.

Maybe merge this and add an issue (possibly even a meta issue) that collects instances like this.

#5177

elapsed.as_secs()
)
});
self.parker.park_deadline(warning.next_warning());
continue;
}
output_backpressure_warning = None;

match trigger.trigger(
self.last_checkpoint,
Expand Down
4 changes: 4 additions & 0 deletions crates/adapters/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,10 @@ impl LongOperationWarning {
self.warn_threshold *= 2;
}
}

pub fn next_warning(&self) -> Instant {
self.start + self.warn_threshold
}
}

#[cfg(test)]
Expand Down
Loading