diff --git a/build.gradle b/build.gradle index cf3659d77..e28fd3a46 100644 --- a/build.gradle +++ b/build.gradle @@ -1,24 +1,23 @@ buildscript { ext { palantirGitVersionVersion = "${JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11) ? '0.15.0' : '0.13.0'}" - kotlinVersion = "${project.hasProperty("edgeDepsTest") ? '1.8.20' : (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16) ? '1.5.32' : '1.4.32')}" } } plugins { - id 'net.ltgt.errorprone' version '3.0.1' apply false + id 'net.ltgt.errorprone' version '4.0.1' apply false id 'org.cadixdev.licenser' version '0.6.1' id 'com.palantir.git-version' version "${palantirGitVersionVersion}" apply false id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' - id 'com.diffplug.spotless' version '6.18.0' apply false - id 'com.github.nbaztec.coveralls-jacoco' version "1.2.15" apply false + id 'com.diffplug.spotless' version '6.25.0' apply false + id 'com.github.nbaztec.coveralls-jacoco' version "1.2.20" apply false // id 'org.jetbrains.kotlin.jvm' version '1.4.32' // id 'org.jetbrains.kotlin.jvm' version '1.5.32' // id 'org.jetbrains.kotlin.jvm' version '1.6.21' // id 'org.jetbrains.kotlin.jvm' version '1.7.22' // id 'org.jetbrains.kotlin.jvm' version '1.8.20' - id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}" apply false + id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false id 'base' } @@ -62,7 +61,7 @@ ext { // test scoped // we don't upgrade to 1.3 and 1.4 because they require slf4j 2.x logbackVersion = project.hasProperty("edgeDepsTest") ? '1.3.5' : '1.2.11' - mockitoVersion = '5.2.0' + mockitoVersion = '5.14.2' junitVersion = '4.13.2' } diff --git a/gradle/errorprone.gradle b/gradle/errorprone.gradle index 9ce654b2e..0334b3e9c 100644 --- a/gradle/errorprone.gradle +++ b/gradle/errorprone.gradle @@ -5,7 +5,7 @@ subprojects { dependencies { errorproneJavac('com.google.errorprone:javac:9+181-r4173-1') if (JavaVersion.current().isJava11Compatible()) { - errorprone('com.google.errorprone:error_prone_core:2.18.0') + errorprone('com.google.errorprone:error_prone_core:2.31.0') } else { errorprone('com.google.errorprone:error_prone_core:2.10.0') } diff --git a/gradle/linting.gradle b/gradle/linting.gradle index 234047af1..fbc410d35 100644 --- a/gradle/linting.gradle +++ b/gradle/linting.gradle @@ -9,7 +9,7 @@ subprojects { target 'src/*/java/**/*.java' targetExclude '**/generated/*' targetExclude '**/.idea/**' - googleJavaFormat('1.16.0') + googleJavaFormat('1.24.0') } kotlin { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cbfa..a4b76b953 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 508322917..df97d72b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 65dcd68d6..f5feea6d6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,10 +85,9 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +134,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +148,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +156,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +201,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85be..9b42019c7 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/temporal-kotlin/build.gradle b/temporal-kotlin/build.gradle index 7b7359254..988b5d952 100644 --- a/temporal-kotlin/build.gradle +++ b/temporal-kotlin/build.gradle @@ -12,6 +12,7 @@ tasks.withType(KotlinCompile).all { kotlinOptions { freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" jvmTarget = project.hasProperty("edgeDepsTest") ? JavaVersion.VERSION_17 : JavaVersion.VERSION_1_8 + languageVersion = "${project.hasProperty("edgeDepsTest") ? '1.8' : (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_16) ? '1.5' : '1.4')}" } } diff --git a/temporal-opentracing/src/main/java/io/temporal/opentracing/StandardTagNames.java b/temporal-opentracing/src/main/java/io/temporal/opentracing/StandardTagNames.java index 0adc33383..102fa876a 100644 --- a/temporal-opentracing/src/main/java/io/temporal/opentracing/StandardTagNames.java +++ b/temporal-opentracing/src/main/java/io/temporal/opentracing/StandardTagNames.java @@ -25,6 +25,7 @@ public class StandardTagNames { public static final String RUN_ID = "runId"; public static final String PARENT_WORKFLOW_ID = "parentWorkflowId"; public static final String PARENT_RUN_ID = "parentRunId"; + /** * @deprecated use {@link io.opentracing.tag.Tags#ERROR} */ diff --git a/temporal-sdk/src/main/java/io/temporal/client/WorkflowClient.java b/temporal-sdk/src/main/java/io/temporal/client/WorkflowClient.java index 7e34da24e..75d04118a 100644 --- a/temporal-sdk/src/main/java/io/temporal/client/WorkflowClient.java +++ b/temporal-sdk/src/main/java/io/temporal/client/WorkflowClient.java @@ -114,6 +114,7 @@ public interface WorkflowClient { /** Use this constant as a query type to get a workflow stack trace. */ String QUERY_TYPE_STACK_TRACE = "__stack_trace"; + /** Replays workflow to the current state and returns empty result or error if replay failed. */ String QUERY_TYPE_REPLAY_ONLY = "__replay_only"; diff --git a/temporal-sdk/src/main/java/io/temporal/internal/common/WorkflowExecutionHistory.java b/temporal-sdk/src/main/java/io/temporal/internal/common/WorkflowExecutionHistory.java index 7c98c4212..1d75494e9 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/common/WorkflowExecutionHistory.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/common/WorkflowExecutionHistory.java @@ -45,6 +45,7 @@ public class WorkflowExecutionHistory { protected static final String DEFAULT_WORKFLOW_ID = "workflow_id_in_replay"; private static final Gson GSON_PRETTY_PRINTER = new GsonBuilder().setPrettyPrinting().create(); + // we stay on using the old API that uses a JsonParser instance instead of static methods // to give users a larger range of supported version @SuppressWarnings("deprecation") diff --git a/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityCallback.java b/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityCallback.java index 12330dbdb..5a2afe29b 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityCallback.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityCallback.java @@ -39,6 +39,7 @@ public interface LocalActivityCallback class LocalActivityFailedException extends RuntimeException { private final @Nonnull Failure failure; private final int lastAttempt; + /** * If this is not null, code that processes this exception will schedule a workflow timer to * continue retrying the execution diff --git a/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityStateMachine.java b/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityStateMachine.java index 2adc85681..4feb781bc 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityStateMachine.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/statemachines/LocalActivityStateMachine.java @@ -64,6 +64,7 @@ final class LocalActivityStateMachine private ExecuteLocalActivityParameters localActivityParameters; private final Functions.Func replaying; + /** Accepts proposed current time. Returns accepted current time. */ private final Functions.Func1 setCurrentTimeCallback; @@ -74,6 +75,7 @@ final class LocalActivityStateMachine /** Workflow timestamp when the LA state machine is initialized */ private final long workflowTimeMillisWhenStarted; + /** * System.nanoTime result at the moment of LA state machine initialization. May be used to * calculate elapsed time diff --git a/temporal-sdk/src/main/java/io/temporal/internal/statemachines/VersionStateMachine.java b/temporal-sdk/src/main/java/io/temporal/internal/statemachines/VersionStateMachine.java index ac934390e..c0c841b98 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/statemachines/VersionStateMachine.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/statemachines/VersionStateMachine.java @@ -45,6 +45,7 @@ final class VersionStateMachine { private final Functions.Proc1 stateMachineSink; @Nullable private Integer version; + /** * This variable is used for replay only. When we replay, we look one workflow task ahead and * preload all version markers to be able to return from Workflow.getVersion called in the event @@ -368,6 +369,7 @@ private VersionStateMachine( this.commandSink = Objects.requireNonNull(commandSink); this.stateMachineSink = stateMachineSink; } + /** * Get the version for this state machine. * diff --git a/temporal-sdk/src/main/java/io/temporal/internal/sync/CancellationScopeImpl.java b/temporal-sdk/src/main/java/io/temporal/internal/sync/CancellationScopeImpl.java index 4f6d4389e..4cb02a9fb 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/sync/CancellationScopeImpl.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/sync/CancellationScopeImpl.java @@ -57,6 +57,7 @@ private static void popCurrent(CancellationScopeImpl expected) { private final Runnable runnable; private CancellationScopeImpl parent; private final Set children = new HashSet<>(); + /** * When disconnected scope has no parent and thus doesn't receive cancellation requests from it. */ diff --git a/temporal-sdk/src/main/java/io/temporal/internal/sync/POJOWorkflowImplementationFactory.java b/temporal-sdk/src/main/java/io/temporal/internal/sync/POJOWorkflowImplementationFactory.java index e07b85d0d..47a9b7b13 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/sync/POJOWorkflowImplementationFactory.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/sync/POJOWorkflowImplementationFactory.java @@ -87,9 +87,11 @@ public final class POJOWorkflowImplementationFactory implements ReplayWorkflowFa /** Key: workflow type name, Value: function that creates SyncWorkflowDefinition instance. */ private final Map> workflowDefinitions = Collections.synchronizedMap(new HashMap<>()); + /** Factories providing instances of workflow classes. */ private final Map, Functions.Func> workflowInstanceFactories = Collections.synchronizedMap(new HashMap<>()); + /** If present then it is called for any unknown workflow type. */ private Functions.Func1 dynamicWorkflowImplementationFactory; diff --git a/temporal-sdk/src/main/java/io/temporal/internal/worker/LocalActivityResult.java b/temporal-sdk/src/main/java/io/temporal/internal/worker/LocalActivityResult.java index b2429317b..51e266b16 100644 --- a/temporal-sdk/src/main/java/io/temporal/internal/worker/LocalActivityResult.java +++ b/temporal-sdk/src/main/java/io/temporal/internal/worker/LocalActivityResult.java @@ -34,6 +34,7 @@ public final class LocalActivityResult { private final @Nullable RespondActivityTaskCompletedRequest executionCompleted; private final @Nullable ExecutionFailedResult executionFailed; private final @Nullable RespondActivityTaskCanceledRequest executionCanceled; + /** * If present, it will cause an immediate WFT failure instead of providing LA result to the * workflow code. diff --git a/temporal-sdk/src/main/java/io/temporal/payload/context/WorkflowSerializationContext.java b/temporal-sdk/src/main/java/io/temporal/payload/context/WorkflowSerializationContext.java index 25b3801fc..c46a81835 100644 --- a/temporal-sdk/src/main/java/io/temporal/payload/context/WorkflowSerializationContext.java +++ b/temporal-sdk/src/main/java/io/temporal/payload/context/WorkflowSerializationContext.java @@ -27,6 +27,7 @@ public class WorkflowSerializationContext implements HasWorkflowSerializationContext { private final @Nonnull String namespace; private final @Nonnull String workflowId; + // We can't currently reliably and consistency provide workflowType to the DataConverter. // 1. Signals and queries don't know workflowType when they are sent. // 2. WorkflowStub#getResult call is not aware of the workflowType, workflowType is an optional diff --git a/temporal-sdk/src/main/java/io/temporal/worker/MetricsType.java b/temporal-sdk/src/main/java/io/temporal/worker/MetricsType.java index fad91fac5..71038bd62 100644 --- a/temporal-sdk/src/main/java/io/temporal/worker/MetricsType.java +++ b/temporal-sdk/src/main/java/io/temporal/worker/MetricsType.java @@ -56,6 +56,7 @@ private MetricsType() {} TEMPORAL_METRICS_PREFIX + "workflow_task_schedule_to_start_latency"; public static final String WORKFLOW_TASK_EXECUTION_LATENCY = TEMPORAL_METRICS_PREFIX + "workflow_task_execution_latency"; + /** Total latency of a workflow task which can include multiple forced decision tasks */ public static final String WORKFLOW_TASK_EXECUTION_TOTAL_LATENCY = TEMPORAL_METRICS_PREFIX + "workflow_task_execution_total_latency"; @@ -66,6 +67,7 @@ private MetricsType() {} /** Workflow task failed, possibly failing workflow or reporting failure to the service. */ public static final String WORKFLOW_TASK_EXECUTION_FAILURE_COUNTER = TEMPORAL_METRICS_PREFIX + "workflow_task_execution_failed"; + /** * Workflow task failed with unhandled exception without replying to the service.
* This typically happens when workflow task fails second time in a row.
@@ -95,6 +97,7 @@ private MetricsType() {} TEMPORAL_METRICS_PREFIX + "activity_execution_failed"; public static final String ACTIVITY_EXEC_CANCELLED_COUNTER = TEMPORAL_METRICS_PREFIX + "activity_execution_cancelled"; + /** * @deprecated use {@link #ACTIVITY_EXEC_CANCELLED_COUNTER} */ @@ -115,6 +118,7 @@ private MetricsType() {} public static final String LOCAL_ACTIVITY_EXEC_CANCELLED_COUNTER = TEMPORAL_METRICS_PREFIX + "local_activity_execution_cancelled"; + /** * @deprecated use {@link #LOCAL_ACTIVITY_EXEC_CANCELLED_COUNTER} */ @@ -124,6 +128,7 @@ private MetricsType() {} public static final String LOCAL_ACTIVITY_EXEC_FAILED_COUNTER = TEMPORAL_METRICS_PREFIX + "local_activity_execution_failed"; + /** * @deprecated use {@link #LOCAL_ACTIVITY_EXEC_FAILED_COUNTER} */ @@ -173,6 +178,7 @@ private MetricsType() {} public static final String STICKY_CACHE_HIT = TEMPORAL_METRICS_PREFIX + "sticky_cache_hit"; // tagged with namespace, task_queue, worker_type, workflow_type public static final String STICKY_CACHE_MISS = TEMPORAL_METRICS_PREFIX + "sticky_cache_miss"; + // tagged with namespace, task_queue, worker_type, workflow_type @Deprecated // This metric in its current form is useless, it's not possible for users to interpret it for any @@ -190,6 +196,7 @@ private MetricsType() {} // Otherwise deprecate it everywhere and remove from docs. public static final String STICKY_CACHE_TOTAL_FORCED_EVICTION = TEMPORAL_METRICS_PREFIX + "sticky_cache_total_forced_eviction"; + // tagged with namespace, task_queue, worker_type, workflow_type public static final String STICKY_CACHE_THREAD_FORCED_EVICTION = TEMPORAL_METRICS_PREFIX + "sticky_cache_thread_forced_eviction"; diff --git a/temporal-serviceclient/src/main/java/io/temporal/internal/retryer/GrpcRetryerUtils.java b/temporal-serviceclient/src/main/java/io/temporal/internal/retryer/GrpcRetryerUtils.java index 335bfb97a..d40f34bd6 100644 --- a/temporal-serviceclient/src/main/java/io/temporal/internal/retryer/GrpcRetryerUtils.java +++ b/temporal-serviceclient/src/main/java/io/temporal/internal/retryer/GrpcRetryerUtils.java @@ -52,9 +52,9 @@ class GrpcRetryerUtils { Status.Code code = currentException.getStatus().getCode(); switch (code) { - // CANCELLED and DEADLINE_EXCEEDED usually considered non-retryable in GRPC world, for - // example: - // https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/retry/retry.go#L287 + // CANCELLED and DEADLINE_EXCEEDED usually considered non-retryable in GRPC world, for + // example: + // https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/retry/retry.go#L287 case CANCELLED: return new CancellationException("The gRPC request was cancelled"); case INVALID_ARGUMENT: diff --git a/temporal-serviceclient/src/main/java/io/temporal/serviceclient/ServiceStubsOptions.java b/temporal-serviceclient/src/main/java/io/temporal/serviceclient/ServiceStubsOptions.java index dd6a7497e..d19303c02 100644 --- a/temporal-serviceclient/src/main/java/io/temporal/serviceclient/ServiceStubsOptions.java +++ b/temporal-serviceclient/src/main/java/io/temporal/serviceclient/ServiceStubsOptions.java @@ -93,6 +93,7 @@ public class ServiceStubsOptions { * Interval at which server will be pinged in order to determine if connections are still alive. */ protected final Duration keepAliveTime; + /** * Amount of time that client would wait for the keep alive ping response from the server before * closing the connection. diff --git a/temporal-serviceclient/src/main/java/io/temporal/serviceclient/WorkflowServiceStubsOptions.java b/temporal-serviceclient/src/main/java/io/temporal/serviceclient/WorkflowServiceStubsOptions.java index 7b9b5e092..5ba5934aa 100644 --- a/temporal-serviceclient/src/main/java/io/temporal/serviceclient/WorkflowServiceStubsOptions.java +++ b/temporal-serviceclient/src/main/java/io/temporal/serviceclient/WorkflowServiceStubsOptions.java @@ -31,9 +31,11 @@ public final class WorkflowServiceStubsOptions extends ServiceStubsOptions { * empty result after this server timeout. */ public static final Duration DEFAULT_SERVER_LONG_POLL_RPC_TIMEOUT = Duration.ofSeconds(60); + /** Default RPC timeout used for all long poll calls. */ public static final Duration DEFAULT_POLL_RPC_TIMEOUT = DEFAULT_SERVER_LONG_POLL_RPC_TIMEOUT.plus(Duration.ofSeconds(10)); + /** Default RPC timeout for workflow queries */ public static final Duration DEFAULT_QUERY_RPC_TIMEOUT = Duration.ofSeconds(10); diff --git a/temporal-spring-boot-autoconfigure/src/main/java/io/temporal/spring/boot/autoconfigure/template/WorkerOptionsTemplate.java b/temporal-spring-boot-autoconfigure/src/main/java/io/temporal/spring/boot/autoconfigure/template/WorkerOptionsTemplate.java index 56a37deb4..39081ac87 100644 --- a/temporal-spring-boot-autoconfigure/src/main/java/io/temporal/spring/boot/autoconfigure/template/WorkerOptionsTemplate.java +++ b/temporal-spring-boot-autoconfigure/src/main/java/io/temporal/spring/boot/autoconfigure/template/WorkerOptionsTemplate.java @@ -82,8 +82,7 @@ WorkerOptions createWorkerOptions() { if (buildIdConfigurations != null) { Optional.ofNullable(buildIdConfigurations.getWorkerBuildId()) .ifPresent(options::setBuildId); - Optional.ofNullable(buildIdConfigurations.getEnabledWorkerVersioning()) - .ifPresent(options::setUseBuildIdForVersioning); + options.setUseBuildIdForVersioning(buildIdConfigurations.getEnabledWorkerVersioning()); } } if (customizer != null) { diff --git a/temporal-test-server/src/main/java/io/temporal/internal/testservice/RequestContext.java b/temporal-test-server/src/main/java/io/temporal/internal/testservice/RequestContext.java index 704220fae..d4a1bfc30 100644 --- a/temporal-test-server/src/main/java/io/temporal/internal/testservice/RequestContext.java +++ b/temporal-test-server/src/main/java/io/temporal/internal/testservice/RequestContext.java @@ -89,6 +89,7 @@ public Functions.Proc getCancellationHandle() { static final class TimerLockChange { private final String caller; + /** +1 or -1 */ private final int change; diff --git a/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateMachines.java b/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateMachines.java index c5e41d07b..13261f6e9 100644 --- a/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateMachines.java +++ b/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateMachines.java @@ -132,10 +132,12 @@ static final class WorkflowData { String cronSchedule; Payloads lastCompletionResult; Optional lastFailure; + /** * @see WorkflowExecutionStartedEventAttributes#getFirstExecutionRunId() */ final @Nonnull String firstExecutionRunId; + /** * @see WorkflowExecutionStartedEventAttributes#getOriginalExecutionRunId() */ diff --git a/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateUtils.java b/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateUtils.java index 7678d2035..5ecf616be 100644 --- a/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateUtils.java +++ b/temporal-test-server/src/main/java/io/temporal/internal/testservice/StateUtils.java @@ -33,6 +33,7 @@ class StateUtils { private static Payload nullPayload = DefaultDataConverter.STANDARD_INSTANCE.toPayload(null).get(); private static Payload emptyListPayload = DefaultDataConverter.STANDARD_INSTANCE.toPayload(new String[] {}).get(); + /** * @return true if the workflow was completed not by workflow task completion result */ diff --git a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java index 165998ff5..db5d8ccd8 100644 --- a/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java +++ b/temporal-test-server/src/main/java/io/temporal/internal/testservice/TestWorkflowMutableStateImpl.java @@ -101,6 +101,7 @@ private interface UpdateProcedure { private final SelfAdvancingTimer timerService; private final LongSupplier clock; private final ExecutionId executionId; + /** Parent workflow if this workflow was started as a child workflow. */ private final Optional parent; @@ -123,6 +124,7 @@ private interface UpdateProcedure { new HashMap<>(); private final Map> updates = new HashMap<>(); private final StateMachine workflow; + /** A single workflow task state machine is used for the whole workflow lifecycle. */ private final StateMachine workflowTaskStateMachine;