Skip to content

Commit c04bf6b

Browse files
authored
Report child workflow started synchronously (#928)
By reporting child workflow started asynchronously we can observe a child workflow attempting to complete prior to its state machine registering that it started. This is an invalid state transition and causes test failures. See temporalio/sdk-java#1289 , we have the same test case still and it has similarly been flakey.
1 parent dc0f0c4 commit c04bf6b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/main/java/com/uber/cadence/internal/testservice/TestWorkflowMutableStateImpl.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,17 +1179,13 @@ public void startWorkflow(
11791179
.setWorkflowExecution(getExecutionId().getExecution())
11801180
.setDomain(getExecutionId().getDomain())
11811181
.setWorkflowType(startRequest.getWorkflowType());
1182-
ForkJoinPool.commonPool()
1183-
.execute(
1184-
() -> {
1185-
try {
1186-
parent.get().childWorkflowStarted(a);
1187-
} catch (EntityNotExistsError | WorkflowExecutionAlreadyCompletedError e) {
1188-
// Not a problem. Parent might just close by now.
1189-
} catch (BadRequestError | InternalServiceError e) {
1190-
log.error("Failure reporting child completion", e);
1191-
}
1192-
});
1182+
try {
1183+
parent.get().childWorkflowStarted(a);
1184+
} catch (EntityNotExistsError | WorkflowExecutionAlreadyCompletedError e) {
1185+
// Not a problem. Parent might just close by now.
1186+
} catch (BadRequestError | InternalServiceError e) {
1187+
log.error("Failure reporting child completion", e);
1188+
}
11931189
}
11941190
}
11951191

0 commit comments

Comments
 (0)