riteshghorse commented on code in PR #26220: URL: https://github.com/apache/beam/pull/26220#discussion_r1174115320
########## sdks/python/apache_beam/runners/worker/sdk_worker_main.py: ########## @@ -173,22 +173,21 @@ def create_harness(environment, dry_run=False): return fn_log_handler, sdk_harness, sdk_pipeline_options -def main(unused_argv): - """Main entry point for SDK Fn Harness.""" - (fn_log_handler, sdk_harness, - sdk_pipeline_options) = create_harness(os.environ) +def _start_profiler_if_enabled(sdk_pipeline_options): experiments = (sdk_pipeline_options.view_as(DebugOptions).experiments or []) - service_name = sdk_pipeline_options.view_as( - GoogleCloudOptions).lookup_dataflow_service_option( - _ENABLE_GOOGLE_CLOUD_PROFILER, default=os.environ["JOB_NAME"]) - - if ((_ENABLE_GOOGLE_CLOUD_PROFILER in experiments) or service_name): + gcp_profiler_service_name = sdk_pipeline_options.view_as( + GoogleCloudOptions).get_cloud_profiler_service_name( + _ENABLE_GOOGLE_CLOUD_PROFILER) + if (_ENABLE_GOOGLE_CLOUD_PROFILER in experiments 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]
