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

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

                Author: ASF GitHub Bot
            Created on: 13/Oct/21 16:40
            Start Date: 13/Oct/21 16:40
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on a change in pull request #15713:
URL: https://github.com/apache/beam/pull/15713#discussion_r728253180



##########
File path: sdks/go/pkg/beam/core/runtime/harness/harness.go
##########
@@ -47,8 +47,10 @@ const cacheSize = 20
 func Main(ctx context.Context, loggingEndpoint, controlEndpoint string) error {
        hooks.DeserializeHooksFromOptions(ctx)
 
+       // Pass in the logging endpoint for use w/the default remote logging 
hook.
+       ctx = context.WithValue(ctx, loggingEndpointCtxKey, loggingEndpoint)

Review comment:
       Yes. An alternative would be to move the remote logging set up to the 
harness/init package, so the flag is plumbed as a flag instead of as the 
context. That would require exporting some of the logging set up so it would be 
accessible though, as we don't want to copy the GRPC code out of the harness 
package. 
   
   Overall, this was the least obtrusive. At worst, the context is carrying 
around an extra value, but this is fine.




-- 
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: 664760)
    Time Spent: 50m  (was: 40m)

> Improvements to hooks module
> ----------------------------
>
>                 Key: BEAM-4424
>                 URL: https://issues.apache.org/jira/browse/BEAM-4424
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-go
>    Affects Versions: Not applicable
>            Reporter: Bill Neubauer
>            Assignee: Robert Burke
>            Priority: P3
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Proposed improvements to the Go hooks API:
> Execution order of the hooks should be based on the order in which the hook 
> is enabled. This gives the runner precise control over ordering so 
> dependencies on hooked behavior can be well-managed.
> Provide an API to disable a hook. Disabling a hook removes it from the 
> ordered list. If the same hook is later re-Enabled, it has lost its previous 
> ordering and would be placed at the end of the ordered list.
> The invocation of setupRemoteLogging() in harness.Main() will be replaced by 
> a hook. This new hook will be called by the default translate code. The net 
> effect is the default behavior for runners remains unchanged. If a runner 
> wants a different logging behavior, it can disable the default logging hook 
> and enable its own hook.



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

Reply via email to