Fix rejectSubsequentInProgressSequence test: cap message sizes for commit failures

Patch by Alex Petrov; reviewed by Sam Tunnicliffe for CASSANDRA-19076.
This commit is contained in:
Alex Petrov 2023-11-23 21:28:29 +01:00
parent f4c969adfc
commit e0766e95bc
1 changed files with 2 additions and 1 deletions

View File

@ -187,7 +187,8 @@ public class Commit
if (message == null)
message = "";
this.code = code;
this.message = message;
// TypeSizes#sizeOf encoder only allows strings that are up to Short.MAX_VALUE bytes large
this.message = message.substring(0, Math.min(message.length(), Short.MAX_VALUE));
this.rejected = rejected;
}