Skip to content

Commit cdc5aab

Browse files
authored
Fix start async return (#529)
1 parent ff05ea1 commit cdc5aab

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/main/java/com/uber/cadence/internal/metrics/MetricsType.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,6 @@ public class MetricsType {
148148
public static final String WORKFLOW_ACTIVE_THREAD_COUNT =
149149
CADENCE_METRICS_PREFIX + "workflow_active_thread_count";
150150

151-
public static final String NON_DETERMINISTIC_ERROR = CADENCE_METRICS_PREFIX + "non-deterministic-error";
151+
public static final String NON_DETERMINISTIC_ERROR =
152+
CADENCE_METRICS_PREFIX + "non-deterministic-error";
152153
}

src/main/java/com/uber/cadence/internal/replay/DecisionsHelper.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,10 @@ private boolean addMissingVersionMarker(
725725
private DecisionStateMachine getDecision(DecisionId decisionId) {
726726
DecisionStateMachine result = decisions.get(decisionId);
727727
if (result == null) {
728-
Scope metricsScope = options
729-
.getMetricsScope()
730-
.tagged(ImmutableMap.of(MetricsTag.WORKFLOW_TYPE, task.getWorkflowType().getName()));
728+
Scope metricsScope =
729+
options
730+
.getMetricsScope()
731+
.tagged(ImmutableMap.of(MetricsTag.WORKFLOW_TYPE, task.getWorkflowType().getName()));
731732
metricsScope.counter(MetricsType.NON_DETERMINISTIC_ERROR).inc(1);
732733
throw new NonDeterminisicWorkflowError(
733734
"Unknown " + decisionId + ". " + NON_DETERMINISTIC_MESSAGE);

src/main/java/com/uber/cadence/internal/replay/ReplayDecider.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,8 @@ public HistoryEvent next() {
645645
Duration decisionTaskRemainingTime = decisionTaskRemainingTime();
646646
if (decisionTaskRemainingTime.isNegative() || decisionTaskRemainingTime.isZero()) {
647647
throw new Error(
648-
"Decision task timed out while querying history. If this happens consistently please consider " +
649-
"increase decision task timeout or reduce history size.");
648+
"Decision task timed out while querying history. If this happens consistently please consider "
649+
+ "increase decision task timeout or reduce history size.");
650650
}
651651

652652
metricsScope.counter(MetricsType.WORKFLOW_GET_HISTORY_COUNTER).inc(1);

src/main/java/com/uber/cadence/internal/sync/WorkflowStubImpl.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public CompletableFuture<WorkflowExecution> startAsyncWithTimeout(
234234
CompletableFuture<WorkflowExecution> result =
235235
startAsyncWithOptions(
236236
timeout, unit, WorkflowOptions.merge(null, null, null, options.get()), args);
237-
result.whenComplete(
237+
return result.whenComplete(
238238
(input, exception) -> {
239239
if (input != null) {
240240
execution.set(
@@ -243,7 +243,6 @@ public CompletableFuture<WorkflowExecution> startAsyncWithTimeout(
243243
.setRunId(input.getRunId()));
244244
}
245245
});
246-
return result;
247246
}
248247

249248
private WorkflowExecution signalWithStartWithOptions(

0 commit comments

Comments
 (0)