Skip to content

Commit

Permalink
Check Replication Summary length (#17546)
Browse files Browse the repository at this point in the history
  • Loading branch information
gosusnp committed Oct 4, 2022
1 parent 7a7091e commit 6e23558
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
public class ReplicationActivityImpl implements ReplicationActivity {

private static final Logger LOGGER = LoggerFactory.getLogger(ReplicationActivityImpl.class);
private static final int MAX_TEMPORAL_MESSAGE_SIZE = 2 * 1024 * 1024;

private final Optional<ContainerOrchestratorConfig> containerOrchestratorConfig;
private final WorkerConfigs workerConfigs;
Expand Down Expand Up @@ -156,7 +157,14 @@ public StandardSyncOutput replicate(final JobRunConfig jobRunConfig,
final ReplicationOutput attemptOutput = temporalAttempt.get();
final StandardSyncOutput standardSyncOutput = reduceReplicationOutput(attemptOutput);

LOGGER.info("sync summary: {}", standardSyncOutput);
final String standardSyncOutputString = standardSyncOutput.toString();
LOGGER.info("sync summary: {}", standardSyncOutputString);
if (standardSyncOutputString.length() > MAX_TEMPORAL_MESSAGE_SIZE) {
LOGGER.error("Sync ouput exceeds the max temporal message size of {}, actual is {}.", MAX_TEMPORAL_MESSAGE_SIZE,
standardSyncOutputString.length());
} else {
LOGGER.info("Sync summary length: {}", standardSyncOutputString.length());
}

return standardSyncOutput;
},
Expand Down

0 comments on commit 6e23558

Please sign in to comment.