File tree Expand file tree Collapse file tree 3 files changed +31
-26
lines changed
main/java/com/uber/cadence
test/java/com/uber/cadence/workflow Expand file tree Collapse file tree 3 files changed +31
-26
lines changed Original file line number Diff line number Diff line change @@ -124,9 +124,10 @@ public Builder setWorkflowId(String workflowId) {
124
124
* conditions Cadence allows two workflows with the same domain and workflow id run
125
125
* simultaneously.
126
126
* <li>
127
- * <ul>
128
- * AllowDuplicateFailedOnly is a default value. It means that workflow can start if
129
- * previous run failed or was cancelled or terminated.
127
+ *
128
+ * <ul>
129
+ * AllowDuplicateFailedOnly is a default value. It means that workflow can start if
130
+ * previous run failed or was cancelled or terminated.
130
131
* </ul>
131
132
*
132
133
* <ul>
@@ -139,9 +140,8 @@ public Builder setWorkflowId(String workflowId) {
139
140
*
140
141
* <ul>
141
142
* TerminateIfRunning terminate current running workflow using the same workflow ID if exist,
142
- * then start a new run in one transaction
143
+ * then start a new run in one transaction
143
144
* </ul>
144
- * </li>
145
145
*/
146
146
public Builder setWorkflowIdReusePolicy (WorkflowIdReusePolicy workflowIdReusePolicy ) {
147
147
this .workflowIdReusePolicy = workflowIdReusePolicy ;
Original file line number Diff line number Diff line change @@ -2302,14 +2302,14 @@ public void StartWorkflowExecution(
2302
2302
public void GetWorkflowExecutionHistory (
2303
2303
GetWorkflowExecutionHistoryRequest getRequest , AsyncMethodCallback resultHandler ) {
2304
2304
CompletableFuture <ThriftResponse <GetWorkflowExecutionHistory_result >> response = null ;
2305
- try {
2306
- ThriftRequest < WorkflowService . GetWorkflowExecutionHistory_args > request =
2307
- buildGetWorkflowExecutionHistoryThriftRequest ( getRequest );
2308
- response = doRemoteCallAsync ( request );
2309
-
2310
- response
2311
- . whenComplete (
2312
- ( r , e ) -> {
2305
+ ThriftRequest < WorkflowService . GetWorkflowExecutionHistory_args > request =
2306
+ buildGetWorkflowExecutionHistoryThriftRequest ( getRequest );
2307
+ response = doRemoteCallAsync ( request );
2308
+
2309
+ response
2310
+ . whenComplete (
2311
+ ( r , e ) -> {
2312
+ try {
2313
2313
if (e != null ) {
2314
2314
resultHandler .onError (CheckedExceptionWrapper .wrap (e ));
2315
2315
return ;
@@ -2336,18 +2336,17 @@ public void GetWorkflowExecutionHistory(
2336
2336
resultHandler .onError (
2337
2337
new TException (
2338
2338
"GetWorkflowExecutionHistory failed with unknown " + "error:" + result ));
2339
- return ;
2340
- })
2341
- .exceptionally (
2342
- (e ) -> {
2343
- log .error ("Unexpected error in GetWorkflowExecutionHistory" , e );
2344
- return null ;
2345
- });
2346
- } finally {
2347
- if (response != null && response .isDone ()) {
2348
- response .join ().release ();
2349
- }
2350
- }
2339
+ } finally {
2340
+ if (r != null ) {
2341
+ r .release ();
2342
+ }
2343
+ }
2344
+ })
2345
+ .exceptionally (
2346
+ (e ) -> {
2347
+ log .error ("Unexpected error in GetWorkflowExecutionHistory" , e );
2348
+ return null ;
2349
+ });
2351
2350
}
2352
2351
2353
2352
@ Override
Original file line number Diff line number Diff line change 18
18
package com .uber .cadence .workflow ;
19
19
20
20
import static com .uber .cadence .worker .NonDeterministicWorkflowPolicy .FailWorkflow ;
21
- import static org .junit .Assert .*;
21
+ import static org .junit .Assert .assertEquals ;
22
+ import static org .junit .Assert .assertFalse ;
23
+ import static org .junit .Assert .assertNotEquals ;
24
+ import static org .junit .Assert .assertNotNull ;
25
+ import static org .junit .Assert .assertNull ;
26
+ import static org .junit .Assert .assertTrue ;
27
+ import static org .junit .Assert .fail ;
22
28
23
29
import com .google .common .util .concurrent .UncheckedExecutionException ;
24
30
import com .uber .cadence .GetWorkflowExecutionHistoryResponse ;
You can’t perform that action at this time.
0 commit comments