Skip to content

Commit

Permalink
Merge pull request cdapio#15559 from cdapio/CDAP-20956
Browse files Browse the repository at this point in the history
[CDAP-20956] increase system worker request retry timeout
  • Loading branch information
itsankit-google authored Feb 22, 2024
2 parents fa149e1 + fb2f45e commit 7eea423
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ public RemoteTaskExecutor(CConfiguration cConf, MetricsCollectionService metrics
this.remoteClient = remoteClientFactory.createRemoteClient(serviceName,
httpRequestConfig,
Constants.Gateway.INTERNAL_API_VERSION_3);
this.retryStrategy = RetryStrategies.fromConfiguration(cConf,
Constants.Service.TASK_WORKER + ".");
this.metricsCollectionService = metricsCollectionService;
if (workerType == Type.TASK_WORKER) {
this.workerUrl = TASK_WORKER_URL;
this.retryStrategy = RetryStrategies.fromConfiguration(cConf,
Constants.Service.TASK_WORKER + ".");
} else {
this.workerUrl = SYSTEM_WORKER_URL;
this.retryStrategy = RetryStrategies.fromConfiguration(cConf,
Constants.Service.SYSTEM_WORKER + ".");
}
}

Expand Down
45 changes: 45 additions & 0 deletions cdap-common/src/main/resources/cdap-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4251,6 +4251,51 @@
</description>
</property>

<!-- Retry configuration for system worker -->
<!-- Use an exponential delay that cap at 2 seconds interval -->
<property>
<name>system.worker.retry.policy.base.delay.ms</name>
<value>100</value>
<description>
The base delay between retries in milliseconds
</description>
</property>

<property>
<name>system.worker.retry.policy.max.delay.ms</name>
<value>2000</value>
<description>
The maximum delay between retries in milliseconds
</description>
</property>

<!-- Set to Integer max value, so the retry attempts end based on task.worker.retry.policy.max.time.secs -->
<property>
<name>system.worker.retry.policy.max.retries</name>
<value>2147483647</value>
<description>
The maximum number of retries to attempt before aborting
</description>
</property>

<!-- Set to 300s to match the default http request timeout -->
<property>
<name>system.worker.retry.policy.max.time.secs</name>
<value>300</value>
<description>
The maximum elapsed time in seconds before retries are aborted
</description>
</property>

<property>
<name>system.worker.retry.policy.type</name>
<value>exponential.backoff</value>
<description>
The type of retry policy for programs. Allowed options:
"none", "fixed.delay", or "exponential.backoff".
</description>
</property>

<!-- Retry configuration for artifact cache -->
<!-- Use an exponential delay that cap at 2 seconds interval -->
<property>
Expand Down

0 comments on commit 7eea423

Please sign in to comment.