Skip to content

Commit

Permalink
Documentation and changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed Oct 13, 2023
1 parent 4243e74 commit d472d01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased changes

## 6.1.7

- Add load-shedding to the V2 GRPC API. In particular, if at the time of the
request the node is already handling more than
`CONCORDIUM_NODE_GRPC2_MAX_CONCURRENT_REQUESTS` requests then the incoming
request will be immediately rejected.

## 6.1.6

- Fix a regression in the start up time. When upgrading from an earlier version, the first start-up
Expand Down
11 changes: 6 additions & 5 deletions concordium-node/src/grpc2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2613,13 +2613,14 @@ where
// an Err(Overloaded). So record resource exhaustion
// in the metrics.
let (code, response) = if e.is::<tower::load_shed::error::Overloaded>() {
// return a response with empty body of the correct type. `to_http`
// constructs a response with a `BoxBody` but
// here we need a more general one to make the service generic enough.
let new_response =
tonic::Status::resource_exhausted("Too many concurrent requests.")
.to_http();
(
tonic::Code::ResourceExhausted,
Ok(new_response.map(|_| Default::default())),
)
.to_http()
.map(|_| Default::default());
(tonic::Code::ResourceExhausted, Ok(new_response))
} else {
(tonic::Code::Internal, Err(e))
};
Expand Down

0 comments on commit d472d01

Please sign in to comment.