Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ private void executeBatchV1(List<PersistentActorUpdateEvent> events) {
try {
executeWithRetry(cassandraSession, batchStatement.bind(arguments.toArray()), logger);
} catch(BatchTooLargeException e) {
// Guard against infinite recursion: if we can't split further, fail with a clear error
if(events.size() <= 1) {
logger.error("Single event of byteSize {} is too large to execute", e.getBatchSize());
throw new IllegalStateException("Single event is too large to process", e);
}
int half = events.size() / 2;
// batch is too large, so we need to split it up
logger.warn(
Expand Down Expand Up @@ -215,6 +220,11 @@ private void executeBatchV1Optimized(List<PersistentActorUpdateEvent> events) {
try {
executeWithRetry(cassandraSession, batchStatement.bind(arguments.toArray()), logger);
} catch(BatchTooLargeException e) {
// Guard against infinite recursion: if we can't split further, fail with a clear error
if(events.size() <= 1) {
logger.error("Single event of byteSize {} is too large to execute", e.getBatchSize());
throw new IllegalStateException("Single event is too large to process", e);
}
int half = events.size() / 2;
// batch is too large, so we need to split it up
logger.warn(
Expand Down Expand Up @@ -244,6 +254,11 @@ private void executeBatchV2AndUp(List<PersistentActorUpdateEvent> events) {
try {
executeWithRetry(cassandraSession, batchStatement, logger);
} catch(BatchTooLargeException e) {
// Guard against infinite recursion: if we can't split further, fail with a clear error
if(events.size() <= 1) {
logger.error("Single event of byteSize {} is too large to execute", e.getBatchSize());
throw new IllegalStateException("Single event is too large to process", e);
}
int half = events.size() / 2;
// batch is too large, so we need to split it up
logger.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ private void executeBatchV3AndUp(List<PersistentActorUpdateEvent> events) {
try {
executeWithRetry(cassandraSession, batchStatement, logger);
} catch (BatchTooLargeException e) {
// Guard against infinite recursion: if we can't split further, fail with a clear error
if(events.size() <= 1) {
logger.error("Single event of byteSize {} is too large to execute", e.getBatchSize());
throw new IllegalStateException("Single event is too large to process", e);
}
int half = events.size() / 2;
// batch is too large, so we need to split it up
logger.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,3 @@ public void testProcessBatchTooLargeWithNineEvents() {
}

}