You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Eternal Orchestrator is replaying external event infinitely #182
Task<Something> event = ctx.waitForExternalEvent("Approval", Something.class);
Task<?> timer = ctx.createTimer(Duration.ofDays(7));
Task<?> winner = ctx.anyOf(event, timer).await();
if (winner == event) {
response = event.await();
if (!ctx.getIsReplaying()) {
context.getLogger().info("winner is the external event");
ctx.continueAsNew(response);
return;
}
}
else {
context.getLogger().info("winner is the timer");
}
The log line "winner is the external event" keeps on printing infinitely. (Note that it's under a condition, so the log line is not replaying.
The event is somehow being replayed again and again with each execution.
Hi kanupriya15025, this is not an issue caused by the long timer. Instead, it's an issue when sdk decides which events to carry over for continueAsNew.
For now, you can use this as workaround if your code doesn't need to carry over unprocessed events to the next orchestration invocation after calling continueAsNew.
Task<Something> event = ctx.waitForExternalEvent("Approval", Something.class);
Task<?> timer = ctx.createTimer(Duration.ofDays(7));
Task<?> winner = ctx.anyOf(event, timer).await();
if (winner == event) {
response = event.await();
if (!ctx.getIsReplaying()) {
context.getLogger().info("winner is the external event");
ctx.continueAsNew(response, false);
return;
}
}
else {
context.getLogger().info("winner is the timer");
}
Activity
kaibocai commentedon Nov 14, 2023
Hi kanupriya15025, this is not an issue caused by the long timer. Instead, it's an issue when sdk decides which events to carry over for
continueAsNew.The fix is ready to merge #183
For now, you can use this as workaround if your code doesn't need to carry over unprocessed events to the next orchestration invocation after calling
continueAsNew.