Skip to content

Commit

Permalink
Default schedule to start timeout (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitarb authored Oct 30, 2020
1 parent a1de809 commit 4b03019
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public static WorkerFactoryOptions getDefaultInstance() {
private static final int DEFAULT_HOST_LOCAL_WORKFLOW_POLL_THREAD_COUNT = 5;
private static final int DEFAULT_WORKFLOW_CACHE_SIZE = 600;
private static final int DEFAULT_MAX_WORKFLOW_THREAD_COUNT = 600;
private static final Duration DEFAULT_STICKY_SCHEDULE_TO_START_TIMEOUT = Duration.ofSeconds(5);

private static final WorkerFactoryOptions DEFAULT_INSTANCE;

Expand All @@ -49,6 +50,7 @@ public static WorkerFactoryOptions getDefaultInstance() {
}

public static class Builder {

private Duration workflowHostLocalTaskQueueScheduleToStartTimeout;
private int workflowCacheSize;
private int maxWorkflowThreadCount;
Expand Down Expand Up @@ -185,6 +187,9 @@ private WorkerFactoryOptions(
!workflowHostLocalTaskQueueScheduleToStartTimeout.isNegative(),
"negative workflowHostLocalTaskQueueScheduleToStartTimeoutSeconds");
}
if (workflowHostLocalTaskQueueScheduleToStartTimeout == null) {
workflowHostLocalTaskQueueScheduleToStartTimeout = DEFAULT_STICKY_SCHEDULE_TO_START_TIMEOUT;
}
if (workflowInterceptors == null) {
workflowInterceptors = new WorkflowInterceptor[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ public WorkflowStub newUntypedWorkflowStub(
WorkerFactoryOptions.newBuilder()
.setWorkflowInterceptors(tracer)
.setActivityInterceptors(activityInterceptor)
.setWorkflowHostLocalTaskQueueScheduleToStartTimeout(Duration.ZERO)
.setWorkflowHostLocalTaskQueueScheduleToStartTimeout(
versionTest ? Duration.ZERO : Duration.ofSeconds(10))
.build();
Expand Down

0 comments on commit 4b03019

Please sign in to comment.