Skip to content

Commit

Permalink
create AcceptError::BufferCapacityReached, use it
Browse files Browse the repository at this point in the history
  • Loading branch information
Keksoj committed May 3, 2023
1 parent acb0455 commit f9de7ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ pub enum AcceptError {
WouldBlock,
RegisterError,
WrongSocketAddress,
BufferCapacityReached,
}

use self::server::ListenToken;
Expand Down
4 changes: 2 additions & 2 deletions lib/src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,11 +1475,11 @@ impl ProxyConfiguration for TcpProxy {
(Some(fb), Some(bb)) => (fb, bb),
_ => {
error!("could not get buffers from pool");
error!("max number of session connection reached, flushing the accept queue");
error!("Buffer capacity has been reached, stopping to accept new connections for now");
gauge!("accept_queue.backpressure", 1);
self.sessions.borrow_mut().can_accept = false;

return Err(AcceptError::TooManySessions);
return Err(AcceptError::BufferCapacityReached);
}
};

Expand Down

0 comments on commit f9de7ba

Please sign in to comment.