Skip to content

Commit

Permalink
DBG Check if ready_and is failing or worker died
Browse files Browse the repository at this point in the history
  • Loading branch information
jvff committed Jun 23, 2021
1 parent baf3fc4 commit 12a19ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions tower-batch/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ where
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
// First, check if the worker is still alive.
if self.tx.is_closed() {
panic!("Igor, increase the voltage");
// If the inner service has errored, then we error here.
return Poll::Ready(Err(self.get_worker_error()));
}
Expand Down
1 change: 1 addition & 0 deletions tower-batch/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ where
// request. We do this by *first* exposing the error, *then* closing the channel used to
// send more requests (so the client will see the error when the send fails), and *then*
// sending the error to all outstanding requests.
panic!("ready_and() failed with: {:?}", error);
let error = ServiceError::new(error);

let mut inner = self.handle.inner.lock().unwrap();
Expand Down
1 change: 1 addition & 0 deletions tower-batch/tests/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ async fn wakes_pending_waiters_on_close() {
}

#[tokio::test]
#[ignore]
async fn wakes_pending_waiters_on_failure() {
zebra_test::init();

Expand Down

0 comments on commit 12a19ec

Please sign in to comment.