Hi all.
This piece of code in certain conditions enters a infinite loop, and to make things worse is in a private method with nothing configurable to avoid it.
while (!persistProcessedSagas(attempts == 0) && status.isRunning()) {
if (attempts == 0) {
logger.warn("Error committing Saga state to the repository. Starting retry procedure...");
}
attempts++;
if (attempts > 1 && attempts < 5) {
logger.info("Waiting 100ms for next attempt");
Thread.sleep(100);
} else if (attempts >= 5) {
logger.info("Waiting 2000ms for next attempt");
long timeToStop = System.currentTimeMillis() + 2000;
while (inFuture(timeToStop) && isLastInBacklog(sequence) && status.isRunning()) {
Thread.sleep(100);
}
}
}
The issue is when a sagaRepository.add(saga) or a sagaRepository.commit(saga) on the call to persistProcessedSagas throws a exception that is not a AxonNonTransientException.
I fixed my particular case by changing a SagaStorageException to a SerializationException but that may not be allways possible.
This is 2.4.6 by the way, I don’t know if this version is still supported nor if this situation happens in 3.x as well.
Any other suggestion besides of what I did (that is not always possible to do ) is welcomed.
Cheers.