Skip to content

Commit

Permalink
Proper handling of long transactions
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Heinrichs <netopyr@users.noreply.github.com>
  • Loading branch information
netopyr committed Apr 28, 2024
1 parent 44da3e4 commit 8346440
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ public void invoke(
// Fail-fast if the request is too large (Note that the request buffer is sized to allow exactly
// 1 more byte than MAX_MESSAGE_SIZE, so we can detect this case).
if (requestBuffer.length() > MAX_MESSAGE_SIZE) {
throw new RuntimeException("More than " + MAX_MESSAGE_SIZE + " received");
callsFailedCounter.increment();
final var exception = new RuntimeException("More than " + MAX_MESSAGE_SIZE + " received");
responseObserver.onError(exception);
return;
}

try {
Expand Down

0 comments on commit 8346440

Please sign in to comment.