Skip to content

Commit

Permalink
ZOOKEEPER-4221: Improve the error message when message goes above jut…
Browse files Browse the repository at this point in the history
…e.maxbufer size

Author: Mathieu Marie <[email protected]>

Reviewers: Damien Diederen <[email protected]>, Mate Szalay-Beko <[email protected]>

Closes #1614 from mariemat/ZOOKEEPER-4221

(cherry picked from commit 94d0c4d)
Signed-off-by: Mate Szalay-Beko <[email protected]>
  • Loading branch information
Mathieu Marie authored and ztzg committed Mar 6, 2021
1 parent 9722488 commit 4b27c62
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,10 @@ private boolean readLength(SelectionKey k) throws IOException {
return false;
}
if (len < 0 || len > BinaryInputArchive.maxBuffer) {
throw new IOException("Len error " + len);
throw new IOException("Len error. "
+ "A message from " + this.getRemoteSocketAddress() + " with advertised length of " + len
+ " is either a malformed message or too large to process"
+ " (length is greater than jute.maxbuffer=" + BinaryInputArchive.maxBuffer + ")");
}
if (!isZKServerRunning()) {
throw new IOException("ZooKeeperServer not running");
Expand Down

0 comments on commit 4b27c62

Please sign in to comment.