Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bring back orchestrator retries #10560

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

import io.airbyte.config.Configs;
import io.airbyte.config.EnvConfigs;
import io.airbyte.workers.WorkerException;
import io.airbyte.workers.temporal.TemporalUtils;
import io.temporal.activity.ActivityCancellationType;
import io.temporal.activity.ActivityOptions;
import io.temporal.common.RetryOptions;
import java.time.Duration;

/**
Expand All @@ -24,12 +26,20 @@ public class ActivityConfiguration {
private static final int MAX_SYNC_TIMEOUT_DAYS = configs.getSyncJobMaxTimeoutDays();
private static final Duration DB_INTERACTION_TIMEOUT = Duration.ofSeconds(configs.getMaxActivityTimeoutSecond());

// retry infinitely if the worker is killed without exceptions and dies due to timeouts
// but fail for everything thrown by the call itself which is rethrown as runtime exceptions
private static final RetryOptions ORCHESTRATOR_RETRY = RetryOptions.newBuilder()
.setDoNotRetry(RuntimeException.class.getName(), WorkerException.class.getName())
.build();

private static final RetryOptions RETRY_POLICY = new EnvConfigs().getContainerOrchestratorEnabled() ? ORCHESTRATOR_RETRY : TemporalUtils.NO_RETRY;

public static final ActivityOptions LONG_RUN_OPTIONS = ActivityOptions.newBuilder()
.setScheduleToCloseTimeout(Duration.ofDays(MAX_SYNC_TIMEOUT_DAYS))
.setStartToCloseTimeout(Duration.ofDays(MAX_SYNC_TIMEOUT_DAYS))
.setScheduleToStartTimeout(Duration.ofDays(MAX_SYNC_TIMEOUT_DAYS))
.setCancellationType(ActivityCancellationType.WAIT_CANCELLATION_COMPLETED)
.setRetryOptions(TemporalUtils.NO_RETRY)
.setRetryOptions(RETRY_POLICY)
.setHeartbeatTimeout(TemporalUtils.HEARTBEAT_TIMEOUT)
.build();

Expand Down