[
https://issues.apache.org/jira/browse/BEAM-8557?focusedWorklogId=339532&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-339532
]
ASF GitHub Bot logged work on BEAM-8557:
----------------------------------------
Author: ASF GitHub Bot
Created on: 06/Nov/19 18:29
Start Date: 06/Nov/19 18:29
Worklog Time Spent: 10m
Work Description: kennknowles commented on pull request #9991:
[BEAM-8557] Cleanup the useless null check for ResponseStreamObserver…
URL: https://github.com/apache/beam/pull/9991#discussion_r343253895
##########
File path:
runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/FnApiControlClient.java
##########
@@ -148,16 +148,14 @@ public void onNext(BeamFnApi.InstructionResponse
response) {
LOG.debug("Received InstructionResponse {}", response);
CompletableFuture<BeamFnApi.InstructionResponse> responseFuture =
outstandingRequests.remove(response.getInstructionId());
- if (responseFuture != null) {
- if (response.getError().isEmpty()) {
- responseFuture.complete(response);
- } else {
- responseFuture.completeExceptionally(
- new RuntimeException(
- String.format(
- "Error received from SDK harness for instruction %s: %s",
- response.getInstructionId(), response.getError())));
- }
+ if (response.getError().isEmpty()) {
Review comment:
I read some code and thought about this. The message comes from the other
side of a gRPC connection. We cannot assume what code is connected. It could be
any of the SDK harnesses, or could be another SDK harness not part of Beam.
Receiving a response for a request where we are not waiting for an answer is
OK. Maybe it means there is a bug in code on the other side of the connection.
I don't think the runner side should crash and terminate. It may be worth a log
message, but then a problem on the SDK harness could cause flooding on the
runner.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 339532)
Time Spent: 1.5h (was: 1h 20m)
> Clean up useless null check.
> ----------------------------
>
> Key: BEAM-8557
> URL: https://issues.apache.org/jira/browse/BEAM-8557
> Project: Beam
> Issue Type: Sub-task
> Components: runner-core, sdk-java-harness
> Reporter: sunjincheng
> Assignee: sunjincheng
> Priority: Major
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> I think we do not need null check here:
> [https://github.com/apache/beam/blob/master/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/control/FnApiControlClient.java#L151]
> Because before the the `onNext` call, the `Future` already put into the queue
> in `handle` method.
>
> I found the test as follows:
> {code:java}
> @Test
> public void testUnknownResponseIgnored() throws Exception{code}
> I do not know why we need test this case? I think it would be better if we
> throw the Exception for an UnknownResponse, otherwise, this may hidden a
> potential bug.
> Please correct me if there anything I misunderstand @kennknowles
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)