Skip to content

Commit cb903a6

Browse files
Merge branch 'master' into SDK-3252
2 parents df9cf2f + 620eeaf commit cb903a6

30 files changed

Lines changed: 1854 additions & 448 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
--dynamic-config-value system.refreshNexusEndpointsMinWait=1000 \
103103
--dynamic-config-value component.callbacks.allowedAddresses='[{"Pattern":"*","AllowInsecure":true}]' \
104104
--dynamic-config-value frontend.workerVersioningWorkflowAPIs=true \
105+
--dynamic-config-value frontend.activityAPIsEnabled=true \
105106
--dynamic-config-value system.enableDeploymentVersions=true &
106107
sleep 10s
107108

.github/workflows/prepare-release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ jobs:
134134
- runner: macos-13
135135
os_family: macOS
136136
arch: amd64
137+
- runner: macos-latest
138+
os_family: macOS
139+
arch: arm64
140+
- runner: ubuntu-24.04-arm
141+
os_family: linux
142+
arch: arm64
137143
- runner: windows-2019
138144
os_family: windows
139145
arch: amd64
@@ -154,8 +160,8 @@ jobs:
154160
if: matrix.os_family != 'Linux'
155161
uses: actions/setup-java@v4
156162
with:
157-
java-version: "11"
158-
distribution: "temurin"
163+
java-version: "21"
164+
distribution: "graalvm"
159165

160166
- name: Set up Gradle
161167
if: matrix.os_family != 'Linux'
@@ -164,24 +170,22 @@ jobs:
164170
- name: Build native test server (non-Docker)
165171
if: matrix.os_family != 'Linux'
166172
run: |
167-
./gradlew :temporal-test-server:build
173+
./gradlew -PnativeBuild :temporal-test-server:nativeBuild
168174
169175
- name: Build native test server (Docker)
170176
if: matrix.os_family == 'Linux'
171177
run: |
172178
docker run \
173179
--rm -w /github/workspace -v "$(pwd):/github/workspace" \
174180
$(docker build -q ./docker/native-image) \
175-
sh -c "./gradlew :temporal-test-server:build"
181+
sh -c "./gradlew -PnativeBuild :temporal-test-server:nativeBuild"
176182
# path ends in a wildcard because on windows the file ends in '.exe'
177-
# path excludes *.txt because native-image also writes a build manifest txt file
178183
- name: Upload executable to workflow
179184
uses: actions/upload-artifact@v4
180185
with:
181186
name: ${{ matrix.os_family }}_${{ matrix.arch }}
182187
path: |
183-
temporal-test-server/build/graal/temporal-test-server*
184-
!temporal-test-server/build/graal/*.txt
188+
temporal-test-server/build/native/nativeCompile/temporal-test-server*
185189
if-no-files-found: error
186190
retention-days: 1
187191

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ before we can merge in any of your changes
88

99
## Development Environment
1010

11-
* Java 11+
11+
* Java 21+
1212
* Docker to run Temporal Server
1313

1414
## Build

docker/native-image/dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Use an old version of Ubuntu to build the test server to maintain compatibility with
22
# older versions of glibc, specifically glib 2.17.
33
FROM ubuntu:18.04
4-
ENV JAVA_HOME=/opt/java/openjdk
5-
COPY --from=eclipse-temurin:21 $JAVA_HOME $JAVA_HOME
4+
ENV JAVA_HOME=/usr/lib64/graalvm/graalvm-community-java21
5+
COPY --from=ghcr.io/graalvm/jdk-community:21 $JAVA_HOME $JAVA_HOME
66
ENV PATH="${JAVA_HOME}/bin:${PATH}"
77
RUN apt-get update
88
RUN apt-get install -y git build-essential zlib1g-dev

gradle/java.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ subprojects {
66

77
java {
88
// graal only supports java 8, 11, 16, 17, 21, 23
9-
sourceCompatibility = project.hasProperty("edgeDepsTest") ? JavaVersion.VERSION_21 : JavaVersion.VERSION_1_8
10-
targetCompatibility = project.hasProperty("edgeDepsTest") ? JavaVersion.VERSION_21 : JavaVersion.VERSION_1_8
9+
sourceCompatibility = project.hasProperty("edgeDepsTest") || project.hasProperty("nativeBuild") ? JavaVersion.VERSION_21 : JavaVersion.VERSION_1_8
10+
targetCompatibility = project.hasProperty("edgeDepsTest") || project.hasProperty("nativeBuild") ? JavaVersion.VERSION_21 : JavaVersion.VERSION_1_8
1111
withJavadocJar()
1212
withSourcesJar()
1313
}
1414

1515
compileJava {
1616
options.encoding = 'UTF-8'
1717
options.compilerArgs << '-Xlint:none' << '-Xlint:deprecation' << '-Werror' << '-parameters'
18-
if (JavaVersion.current().isJava9Compatible() && !project.hasProperty("edgeDepsTest")) {
18+
if (JavaVersion.current().isJava9Compatible() && !project.hasProperty("edgeDepsTest") && !project.hasProperty("nativeBuild")) {
1919
// https://stackoverflow.com/a/43103115/525203
2020
options.compilerArgs.addAll(['--release', '8'])
2121
}
@@ -24,7 +24,7 @@ subprojects {
2424
compileTestJava {
2525
options.encoding = 'UTF-8'
2626
options.compilerArgs << '-Xlint:none' << '-Xlint:deprecation' << '-Werror' << '-parameters'
27-
if (JavaVersion.current().isJava9Compatible() && !project.hasProperty("edgeDepsTest")) {
27+
if (JavaVersion.current().isJava9Compatible() && !project.hasProperty("edgeDepsTest") && !project.hasProperty("nativeBuild")) {
2828
// https://stackoverflow.com/a/43103115/525203
2929
options.compilerArgs.addAll(['--release', '8'])
3030
}

releases/v1.29.0

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# **💥 BREAKING CHANGES**
2+
3+
## Slot Supplier
4+
5+
The `SlotSupplier` interface was changed to be async to match other languages and allow for future optimizations in the SDK.
6+
7+
# **Highlights**
8+
9+
## Priority (Pre-release)
10+
11+
Users can now set a priority key when scheduling a workflow, activity or child workflow. The priority key will be used to help prioritize certain tasks over others when there is a backlog. Priority is currently not supported in any OSS Temporal release, but support will be coming soon. To experiment with this feature please see the [pre-release development server](https://github.com/temporalio/cli/releases/tag/v1.3.1-priority.0) or if you are a Temporal Cloud customer reach out to your SA.
12+
13+
## Activity Pause (Pre-release)
14+
15+
The Java SDK now supports activity pause for heart beating activities. If an activity is paused while an attempt is running and the activity is heart-beating the heartbeat will throw an `io.temporal.clientActivityPausedException`.
16+
17+
## Versioning / Safe Deploy (Pre-release)
18+
19+
This release introduces a preview of new APIs that gracefully manage code changes and worker pools that support them. The goal is to better control which workers should execute new, and existing, workflows and activities tasks, based on their code and configuration.
20+
21+
`AutoUpgrade` and `Pinned` are two Versioning Behaviors that can be specified on a workflow implementation using `@WorkflowVersioningBehavior`. `Pinned` workflows are typically short lived, and are never affected by new versions, i.e., they do not need to use the patch API for compatibility. `AutoUpgrade` workflows are mostly long running, but they need to use patching to safely transition to new versions. The choice of `Pinned` vs `AutoUpgrade` ultimately depends on your willingness to keep old worker fleets running vs the complexity of patching.
22+
23+
To manage Worker Deployments please use the Temporal CLI, or the `WorkflowServiceStubs`.
24+
25+
# What's Changed
26+
27+
2025-03-10 - 73cb1e96 - Fix API key auth (#2438)
28+
2025-03-10 - ff949711 - Release v1.28.1 (#2439)
29+
2025-03-11 - 02711928 - Add OnConflictOptions Support (#2415)
30+
2025-03-11 - 334e1294 - Add support for metadata to test server (#2441)
31+
2025-03-13 - f7b8ded7 - Unblock UseExisting conflict policy for Nexux WorkflowRunOperation (#2440)
32+
2025-03-14 - 23771149 - Fix workflow ID reuse policy and conflict policy handling (#2446)
33+
2025-03-17 - 48b72239 - Fix spring boot api key enable https (#2445)
34+
2025-03-17 - d430114f - Add Summary to Nexus Operations (#2444)
35+
2025-03-19 - 59bbabbb - Make sure the Schedule Client has the namespace header injected (#2452)
36+
2025-03-20 - 6c4c1835 - Remove experimental tag from Nexus (#2454)
37+
2025-03-24 - ead142ea - :boom: [Breaking] Asyncify slot suppliers (#2433)
38+
2025-03-25 - 93f124f4 - Priorities for Workflows/Activities (#2453)
39+
2025-03-26 - ad4a4262 - Ensure heartbeat details aren't cleared (#2460)
40+
2025-03-31 - c9a1502e - Add support for start delay to the time skipping test server (#2462)
41+
2025-04-02 - 75f5d1af - Update Gradle validation action (#2468)
42+
2025-04-02 - b3b78064 - Worker Versioning Annotations & Options (#2463)
43+
2025-04-07 - e3921b63 - Add support for workflow init in Springboot (#2470)
44+
2025-04-15 - 78a766f3 - Align root workflow execution with real server (#2477)
45+
2025-04-15 - 8808c407 - Add support for activity pause (#2476)
46+
2025-04-15 - b6ae9b54 - De-flake asserting slot metrics (#2478)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3+
*
4+
* Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5+
*
6+
* Modifications copyright (C) 2017 Uber Technologies, Inc.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this material except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
package io.temporal.client;
22+
23+
import io.temporal.activity.ActivityInfo;
24+
25+
/***
26+
* Indicates that the activity was paused by the user.
27+
*
28+
* <p>Catching this exception directly is discouraged and catching the parent class {@link ActivityCompletionException} is recommended instead.<br>
29+
*/
30+
public final class ActivityPausedException extends ActivityCompletionException {
31+
public ActivityPausedException(ActivityInfo info) {
32+
super(info);
33+
}
34+
35+
public ActivityPausedException() {
36+
super();
37+
}
38+
}

temporal-sdk/src/main/java/io/temporal/client/ActivityWorkerShutdownException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* Indicates that {@link WorkerFactory#shutdown()} or {@link WorkerFactory#shutdownNow()} was
29-
* called. It is OK to ignore the exception to let activity to complete. It assumes that {@link
29+
* called. It is OK to ignore the exception to let the activity complete. It assumes that {@link
3030
* WorkerFactory#awaitTermination(long, TimeUnit)} is called with a timeout larger than the activity
3131
* execution time.
3232
*/

temporal-sdk/src/main/java/io/temporal/internal/activity/HeartbeatContextImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ private void sendHeartbeatRequest(Object details) {
216216
metricsScope);
217217
if (status.getCancelRequested()) {
218218
lastException = new ActivityCanceledException(info);
219+
} else if (status.getActivityPaused()) {
220+
lastException = new ActivityPausedException(info);
219221
} else {
220222
lastException = null;
221223
}

temporal-sdk/src/main/java/io/temporal/internal/nexus/OperationTokenUtil.java

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,15 @@ public class OperationTokenUtil {
3737
/**
3838
* Load a workflow run operation token from an operation token.
3939
*
40-
* @throws FallbackToWorkflowIdException if the operation token is not a workflow run token
4140
* @throws IllegalArgumentException if the operation token is invalid
4241
*/
43-
public static WorkflowRunOperationToken loadWorkflowRunOperationToken(String operationToken)
44-
throws FallbackToWorkflowIdException {
42+
public static WorkflowRunOperationToken loadWorkflowRunOperationToken(String operationToken) {
4543
WorkflowRunOperationToken token;
4644
try {
4745
JavaType reference = mapper.getTypeFactory().constructType(WorkflowRunOperationToken.class);
4846
token = mapper.readValue(decoder.decode(operationToken), reference);
4947
} catch (Exception e) {
50-
throw new FallbackToWorkflowIdException("Failed to parse operation token: " + e.getMessage());
48+
throw new IllegalArgumentException("Failed to parse operation token: " + e.getMessage());
5149
}
5250
if (!token.getType().equals(OperationTokenType.WORKFLOW_RUN)) {
5351
throw new IllegalArgumentException(
@@ -68,16 +66,7 @@ public static WorkflowRunOperationToken loadWorkflowRunOperationToken(String ope
6866
* @throws IllegalArgumentException if the operation token is invalid
6967
*/
7068
public static String loadWorkflowIdFromOperationToken(String operationToken) {
71-
try {
72-
WorkflowRunOperationToken token = loadWorkflowRunOperationToken(operationToken);
73-
return token.getWorkflowId();
74-
} catch (OperationTokenUtil.FallbackToWorkflowIdException e) {
75-
// Previous versions of the SDK simply used the workflow ID as the operation token
76-
// This fallback is provided for backwards compatibility for those cases.
77-
// This fallback will be removed in a future release.
78-
// See: https://github.com/temporalio/sdk-java/issues/2423
79-
return operationToken;
80-
}
69+
return loadWorkflowRunOperationToken(operationToken).getWorkflowId();
8170
}
8271

8372
/** Generate a workflow run operation token from a workflow ID and namespace. */
@@ -87,11 +76,5 @@ public static String generateWorkflowRunOperationToken(String workflowId, String
8776
return encoder.encodeToString(json.getBytes());
8877
}
8978

90-
public static class FallbackToWorkflowIdException extends RuntimeException {
91-
public FallbackToWorkflowIdException(String message) {
92-
super(message);
93-
}
94-
}
95-
9679
private OperationTokenUtil() {}
9780
}

0 commit comments

Comments
 (0)