Skip to content
Merged
Show file tree
Hide file tree
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 @@ -38,6 +38,7 @@
import java.util.function.Supplier;
import org.apache.polaris.core.PolarisCallContext;
import org.apache.polaris.core.auth.PolarisPrincipal;
import org.apache.polaris.core.config.FeatureConfiguration;
import org.apache.polaris.core.entity.LocationBasedEntity;
import org.apache.polaris.core.entity.PolarisBaseEntity;
import org.apache.polaris.core.entity.PolarisEntity;
Expand Down Expand Up @@ -555,9 +556,7 @@ public EntitiesResult loadTasks(
long taskAgeTimeout =
callCtx
.getRealmConfig()
.getConfig(
PolarisTaskConstants.TASK_TIMEOUT_MILLIS_CONFIG,
PolarisTaskConstants.TASK_TIMEOUT_MILLIS);
.getConfig(FeatureConfiguration.POLARIS_TASK_TIMEOUT_MILLIS);
return taskState == null
|| taskState.executor == null
|| clock.millis() - taskState.lastAttemptStartTime > taskAgeTimeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ public static void enforceFeatureEnabledOrThrow(
.defaultValue(true)
.buildFeatureConfiguration();

public static final FeatureConfiguration<Long> POLARIS_TASK_TIMEOUT_MILLIS =
PolarisConfiguration.<Long>builder()
.key("POLARIS_TASK_TIMEOUT_MILLIS")
.description(
"Polaris task expiry timeout (milliseconds). Older unfinished tasks may not be processed.")
.defaultValue(300_000L)
.buildFeatureConfiguration();

public static final FeatureConfiguration<Integer> STORAGE_CREDENTIAL_DURATION_SECONDS =
PolarisConfiguration.<Integer>builder()
.key("STORAGE_CREDENTIAL_DURATION_SECONDS")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@
*/
package org.apache.polaris.core.entity;

import org.apache.polaris.core.config.FeatureConfiguration;

/** Constants used to store task properties and configuration parameters */
public class PolarisTaskConstants {
/**
* @deprecated Use {@link FeatureConfiguration#POLARIS_TASK_TIMEOUT_MILLIS}
*/
@Deprecated(forRemoval = true)
public static final long TASK_TIMEOUT_MILLIS = 300000;

/**
* @deprecated Use {@link FeatureConfiguration#POLARIS_TASK_TIMEOUT_MILLIS}
*/
@Deprecated(forRemoval = true)
public static final String TASK_TIMEOUT_MILLIS_CONFIG = "POLARIS_TASK_TIMEOUT_MILLIS";

public static final String LAST_ATTEMPT_EXECUTOR_ID = "lastAttemptExecutorId";
public static final String LAST_ATTEMPT_START_TIME = "lastAttemptStartTime";
public static final String ATTEMPT_COUNT = "attemptCount";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1536,9 +1536,7 @@ public void deletePrincipalSecrets(
long taskAgeTimeout =
callCtx
.getRealmConfig()
.getConfig(
PolarisTaskConstants.TASK_TIMEOUT_MILLIS_CONFIG,
PolarisTaskConstants.TASK_TIMEOUT_MILLIS);
.getConfig(FeatureConfiguration.POLARIS_TASK_TIMEOUT_MILLIS);
return taskState == null
|| taskState.executor == null
|| clock.millis() - taskState.lastAttemptStartTime > taskAgeTimeout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2033,9 +2033,7 @@ private PolarisEntityResolver resolveSecurableToRoleGrant(
long taskAgeTimeout =
callCtx
.getRealmConfig()
.getConfig(
PolarisTaskConstants.TASK_TIMEOUT_MILLIS_CONFIG,
PolarisTaskConstants.TASK_TIMEOUT_MILLIS);
.getConfig(FeatureConfiguration.POLARIS_TASK_TIMEOUT_MILLIS);
return taskState == null
|| taskState.executor == null
|| clock.millis() - taskState.lastAttemptStartTime > taskAgeTimeout;
Expand Down