Failure Detection Flashcards

(7 cards)

1
Q

What is

A

In Temporal, timeouts detect application failures. The system can then automatically mitigate these failures through retries. Both major application function primitives, Workflows and Activities, have dedicated timeout configurations and can be configured with a Retry Policy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Workflow Retry

A

Workflow timeouts are set when starting the Workflow Execution. Generally do not recommend setting Workflow Timeouts, because Workflows are designed to be long-running and resilient. Instead, setting a Timeout can limit its ability to handle unexpected delays or long-running processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Workflow Timeout

A

//create Workflow stub for YourWorkflowInterface
YourWorkflowInterface workflow1 =
WorkerGreet.greetclient.newWorkflowStub(
GreetWorkflowInterface.class,
WorkflowOptions.newBuilder()
.setWorkflowId(“YourWorkflow”)
.setTaskQueue(WorkerGreet.TASK_QUEUE)
// Set Workflow Timeout duration
.setWorkflowExecutionTimeout(Duration.ofSeconds(10))
// .setWorkflowRunTimeout(Duration.ofSeconds(10))
// .setWorkflowTaskTimeout(Duration.ofSeconds(10))
.build());

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Workflow Retry

A

Use a Retry Policy to retry a Workflow Execution in the event of a failure.
GreetWorkflowInterface workflow1 =
WorkerGreet.greetclient.newWorkflowStub(
GreetWorkflowInterface.class,
WorkflowOptions.newBuilder()
.setWorkflowId(“GreetWF”)
.setTaskQueue(WorkerGreet.TASK_QUEUE)
// Set Workflow Retry Options
.setRetryOptions(RetryOptions.newBuilder()
.build());

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Activity Timeout

A

The following timeouts are available in the Activity Options.

Schedule-To-Close Timeout: is the maximum amount of time allowed for the overall Activity Execution.
Start-To-Close Timeout: is the maximum time allowed for a single Activity Task Execution.
Schedule-To-Start Timeout: is the maximum amount of time that is allowed from when an Activity Task is scheduled to when a Worker starts that Activity Task.
An Activity Execution must have either the Start-To-Close or the Schedule-To-Close Timeout set.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Activity Retry

A

Activity Executions are automatically associated with a default Retry Policy if a custom one is not provided.
private final ActivityOptions options =
ActivityOptions.newBuilder()
// note that either StartToCloseTimeout or ScheduleToCloseTimeout are
// required when setting Activity options.
.setStartToCloseTimeout(Duration.ofSeconds(5))
.setRetryOptions(
RetryOptions.newBuilder()
.setInitialInterval(Duration.ofSeconds(1))
.setMaximumInterval(Duration.ofSeconds(10))
.build())
.build();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Activity Retry

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly