Skip to content

Commit

Permalink
fix(transport): reconnect timeout on processing error
Browse files Browse the repository at this point in the history
  • Loading branch information
mempirate committed Oct 23, 2023
1 parent 5970ca1 commit e58a8b7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions msg-transport/src/durable/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,18 @@ where
reconnect_status.current_attempt = Some(attempt);
}
SessionState::Processing(_) => {
error!("Session was disconnected from {}", self.endpoint);
error!(
"Session was disconnected from {} during processing stage",
self.endpoint
);
let attempt = Box::pin(async move {
tokio::time::sleep(Duration::from_millis(100)).await;
Io::establish(endpoint).await
});

self.state = SessionState::Disconnected(ReconnectStatus {
attempts: 0,
current_attempt: Some(Io::establish(self.endpoint)),
current_attempt: Some(attempt),
});
}
SessionState::Terminated(_) => {
Expand Down

0 comments on commit e58a8b7

Please sign in to comment.