Skip to content

Commit

Permalink
Merge pull request #1133 from sozu-proxy/devel/edemolis/fix/pipe-soft…
Browse files Browse the repository at this point in the history
…lock

Fix worker soft lock
  • Loading branch information
Keksoj authored Aug 29, 2024
2 parents 409af59 + 5ab35c2 commit a830613
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions lib/src/protocol/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ impl<Front: SocketHandler, L: ListenerHandler> Pipe<Front, L> {
if self.frontend_buffer.available_data() == 0 {
self.frontend_readiness.interest.insert(Ready::READABLE);
self.backend_readiness.interest.remove(Ready::WRITABLE);
count!("back_bytes_out", sz as i64);
metrics.backend_bout += sz;
return SessionResult::Continue;
}

Expand All @@ -531,6 +533,7 @@ impl<Front: SocketHandler, L: ListenerHandler> Pipe<Front, L> {
}
}

count!("back_bytes_out", sz as i64);
metrics.backend_bout += sz;

if !self.check_connections() {
Expand Down
6 changes: 2 additions & 4 deletions lib/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ impl SocketHandler for FrontRustls {
}

match self.session.writer().write(&buf[buffered_size..]) {
Ok(0) => {
break;
}
Ok(0) => {} // zero byte written means that the Rustls buffers are full, we will try to write on the socket and try again
Ok(sz) => {
buffered_size += sz;
}
Expand Down Expand Up @@ -363,7 +361,7 @@ impl SocketHandler for FrontRustls {
let mut is_closed = false;

match self.session.writer().write_vectored(bufs) {
Ok(0) => {}
Ok(0) => {} // zero byte written means that the Rustls buffers are full, we will try to write on the socket and try again
Ok(sz) => {
buffered_size += sz;
}
Expand Down

0 comments on commit a830613

Please sign in to comment.