m-trieu commented on code in PR #32774:
URL: https://github.com/apache/beam/pull/32774#discussion_r1839906288
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStream.java:
##########
@@ -187,21 +208,26 @@ private long uniqueId() {
}
@Override
- public KeyedGetDataResponse requestKeyedData(String computation,
KeyedGetDataRequest request) {
+ public KeyedGetDataResponse requestKeyedData(String computation,
KeyedGetDataRequest request)
+ throws WindmillStreamShutdownException {
return issueRequest(
QueuedRequest.forComputation(uniqueId(), computation, request),
KeyedGetDataResponse::parseFrom);
}
@Override
- public GlobalData requestGlobalData(GlobalDataRequest request) {
+ public GlobalData requestGlobalData(GlobalDataRequest request)
+ throws WindmillStreamShutdownException {
return issueRequest(QueuedRequest.global(uniqueId(), request),
GlobalData::parseFrom);
}
@Override
- public void refreshActiveWork(Map<String, Collection<HeartbeatRequest>>
heartbeats) {
- if (isShutdown()) {
- throw new WindmillStreamShutdownException("Unable to refresh work for
shutdown stream.");
+ public void refreshActiveWork(Map<String, Collection<HeartbeatRequest>>
heartbeats)
+ throws WindmillStreamShutdownException {
+ synchronized (this) {
+ if (isShutdown) {
Review Comment:
done
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStream.java:
##########
@@ -301,39 +341,58 @@ public void appendSpecificHtml(PrintWriter writer) {
writer.append("]");
}
- private <ResponseT> ResponseT issueRequest(QueuedRequest request,
ParseFn<ResponseT> parseFn) {
- while (true) {
+ private <ResponseT> ResponseT issueRequest(QueuedRequest request,
ParseFn<ResponseT> parseFn)
+ throws WindmillStreamShutdownException {
+ while (!isShutdownLocked()) {
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]