ajamato commented on a change in pull request #15597:
URL: https://github.com/apache/beam/pull/15597#discussion_r716935118
##########
File path:
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/control/BeamFnControlClient.java
##########
@@ -102,18 +103,26 @@ public BeamFnControlClient(
}
@Override
- public void onNext(BeamFnApi.InstructionRequest value) {
- LOG.debug("Received InstructionRequest {}", value);
- executor.execute(
- () -> {
- try {
- BeamFnApi.InstructionResponse response =
delegateOnInstructionRequestType(value);
- sendInstructionResponse(response);
- } catch (Error e) {
- sendErrorResponse(e);
- throw e;
- }
- });
+ public void onNext(BeamFnApi.InstructionRequest request) {
+ try {
+ BeamFnLoggingMDC.setInstructionId(request.getInstructionId());
+ LOG.debug("Received InstructionRequest {}", request);
+ executor.execute(
+ () -> {
+ try {
+ BeamFnLoggingMDC.setInstructionId(request.getInstructionId());
Review comment:
nit: Maybe add a comment stating that the callback runs on a separate
thread, which is why we need to set the instruction id here as well, might not
be obvious to every reader.
--
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]