tvalentyn commented on code in PR #35391:
URL: https://github.com/apache/beam/pull/35391#discussion_r2305243881
##########
sdks/python/apache_beam/runners/worker/worker_status.py:
##########
@@ -257,45 +257,50 @@ def _log_lull_in_bundle_processor(self,
bundle_process_cache):
self._log_lull_sampler_info(info, instruction)
def _log_lull_sampler_info(self, sampler_info, instruction):
- if (sampler_info and sampler_info.time_since_transition):
- lull_seconds = sampler_info.time_since_transition / 1e9
- step_name = sampler_info.state_name.step_name
- state_name = sampler_info.state_name.name
- if step_name and state_name:
- step_name_log = (
- ' for PTransform{name=%s, state=%s}' % (step_name, state_name))
- else:
- step_name_log = ''
-
- stack_trace = self._get_stack_trace(sampler_info)
- if (self._passed_lull_timeout_since_last_log() and
- sampler_info.time_since_transition > self.log_lull_timeout_ns):
- _LOGGER.warning(
- (
- 'Operation ongoing in bundle %s%s for at least %.2f seconds'
- ' without outputting or completing.\n'
- 'Current Traceback:\n%s'),
- instruction,
- step_name_log,
- lull_seconds,
- stack_trace,
- )
- if (self._element_processing_timeout_ns and
- sampler_info.time_since_transition
- > self._element_processing_timeout_ns):
- _LOGGER.error(
- (
- 'Operation ongoing in bundle %s%s for at least %.2f seconds'
- ' without outputting or completing.\n'
- 'Current Traceback:\n%s'),
- instruction,
- step_name_log,
- lull_seconds,
- stack_trace,
- )
- from apache_beam.runners.worker.sdk_worker_main import
flush_fn_log_handler
-
- flush_fn_log_handler()
+ if (not sampler_info or not sampler_info.time_since_transition):
+ return
+
+ log_lull = self._passed_lull_timeout_since_last_log(
Review Comment:
Formatting looks a bit off. Try adding brackets + run YAPF.
log_lull = (
self._passed_lull_timeout_since_last_log()
and sampler_info.time_since_transition > self.log_lull_timeout_ns
)
timeout_exceeded = (
self._element_processing_timeout_ns
and sampler_info.time_since_transition >
self._element_processing_timeout_ns
)
--
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]