My workflow logic using java-sdk is something like :
void init(xyz)
{
.
.
.
Workflow.await(Duration.ofMinutes(15), () → exitRequested);
AbcWf continueAsNew = Workflow.newContinueAsNewStub(AbcWf.class);
continueAsNew.init(xyz);
}
Workflow performs some operations, then wait for 15mins and then it continueAsNew.
It runs smoothly for some days and then suddenly workflow status changes to TimedOut.
I am not able to figure out why this is happening and how to solve this issue.
Workflow is getting timedout mostly before the 15mins timer is fired.
Hi @antonio.perez
While starting the init workflow i am setting these workflowoptions
WorkflowOptions.newBuilder()
.setWorkflowId(wfId)
.setTaskQueue(taskQueue)
.setWorkflowExecutionTimeout(Duration.ofDays(10))
.build())
FYI i am not setting any ContinueAsNewOptions
It looks like the workflow is timed out due to setWorkflowExecutionTimeout
A Workflow Execution Timeout is the maximum time that a Workflow Execution can be executing (have an Open status) including retries and any usage of Continue As New.
@antonio.perez
We are observing this TimedOut exception recently and its quite frequent.
Earlier also we were using same execution timeout in workflow options and the workflow used to run for months as expected.
So, when I am doing continueAsNew.init(xyz);
it should be starting a new execution for the init workflow with new executionTimeout.
Execution timeout is specified when a workflow is started. It specifies the overall timeout for the whole chain of workflows that call continue-as-new. it is not possible to change it from the workflow by calling continue-as-new.