File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed
src/main/java/com/uber/cadence Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,7 @@ public static HistoryEvent getInstanceCloseEvent(
196
196
r .setExecution (workflowExecution );
197
197
r .setHistoryEventFilterType (HistoryEventFilterType .CLOSE_EVENT );
198
198
r .setNextPageToken (pageToken );
199
+ r .setWaitForNewEvent (true );
199
200
try {
200
201
response =
201
202
Retryer .retryWithResult (retryParameters , () -> service .GetWorkflowExecutionHistory (r ));
Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ final class LocalActivityPollTask
33
33
34
34
@ Override
35
35
public LocalActivityWorker .Task poll () throws TException {
36
- return pendingTasks .poll ();
36
+ try {
37
+ return pendingTasks .take ();
38
+ } catch (InterruptedException e ) {
39
+ throw new RuntimeException ("local activity poll task interrupted" , e );
40
+ }
37
41
}
38
42
39
43
@ Override
Original file line number Diff line number Diff line change @@ -808,10 +808,20 @@ private GetWorkflowExecutionHistoryResponse getWorkflowExecutionHistory(
808
808
GetWorkflowExecutionHistoryRequest getRequest ) throws TException {
809
809
ThriftResponse <WorkflowService .GetWorkflowExecutionHistory_result > response = null ;
810
810
try {
811
- ThriftRequest <WorkflowService .GetWorkflowExecutionHistory_args > request =
812
- buildThriftRequest (
813
- "GetWorkflowExecutionHistory" ,
814
- new WorkflowService .GetWorkflowExecutionHistory_args (getRequest ));
811
+ ThriftRequest <WorkflowService .GetWorkflowExecutionHistory_args > request ;
812
+ if (getRequest .isWaitForNewEvent ()) {
813
+ request =
814
+ buildThriftRequest (
815
+ "GetWorkflowExecutionHistory" ,
816
+ new WorkflowService .GetWorkflowExecutionHistory_args (getRequest ),
817
+ options .getRpcLongPollTimeoutMillis ());
818
+ } else {
819
+ request =
820
+ buildThriftRequest (
821
+ "GetWorkflowExecutionHistory" ,
822
+ new WorkflowService .GetWorkflowExecutionHistory_args (getRequest ));
823
+ }
824
+
815
825
response = doRemoteCall (request );
816
826
WorkflowService .GetWorkflowExecutionHistory_result result =
817
827
response .getBody (WorkflowService .GetWorkflowExecutionHistory_result .class );
You can’t perform that action at this time.
0 commit comments