[ 
https://issues.apache.org/jira/browse/BEAM-12611?focusedWorklogId=656408&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-656408
 ]

ASF GitHub Bot logged work on BEAM-12611:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Sep/21 19:46
            Start Date: 28/Sep/21 19:46
    Worklog Time Spent: 10m 
      Work Description: 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 656408)
    Time Spent: 2h 40m  (was: 2.5h)

> Populate instruction id in Java SDK harness log entries
> -------------------------------------------------------
>
>                 Key: BEAM-12611
>                 URL: https://issues.apache.org/jira/browse/BEAM-12611
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-harness
>            Reporter: Luke Cwik
>            Assignee: Alex Amato
>            Priority: P2
>             Fix For: 2.32.0
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to