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

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

                Author: ASF GitHub Bot
            Created on: 09/Oct/19 01:21
            Start Date: 09/Oct/19 01:21
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on pull request #9746: [BEAM-8333] 
Adding lull logging for SDK harness
URL: https://github.com/apache/beam/pull/9746#discussion_r332796254
 
 

 ##########
 File path: sdks/python/apache_beam/runners/worker/sdk_worker.py
 ##########
 @@ -403,10 +412,35 @@ def process_bundle_split(self, request, instruction_id):
           instruction_id=instruction_id,
           error='Instruction not running: %s' % instruction_id)
 
+  def _log_lull_in_bundle_processor(self, processor):
+    state_sampler = processor.state_sampler
+    sampler_info = state_sampler.get_info()
+    if (sampler_info
+        and sampler_info.time_since_transition
+        and sampler_info.time_since_transition > self.log_lull_timeout_ns):
+      step_name = sampler_info.state_name.step_name
+      state_name = sampler_info.state_name.name
+      state_lull_log = (
+          'There has been a processing lull of over %.2f seconds in state %s'
+          % (sampler_info.time_since_transition / 1e9, state_name))
+      step_name_log = (' in step %s ' % step_name) if step_name else ''
+
+      exec_thread = getattr(sampler_info, 'tracked_thread', None)
+      if exec_thread is not None:
+        thread_frame = sys._current_frames().get(exec_thread.ident)  # pylint: 
disable=protected-access
+        stack_trace = '\n'.join(
+            traceback.format_stack(thread_frame)) if thread_frame else ''
+      else:
+        stack_trace = '-NOT AVAILABLE-'
 
 Review comment:
   This should not occur, as the state sampler always marks the thread that 
it's looking at - but I'd like to be cautious.
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 325418)
    Time Spent: 1.5h  (was: 1h 20m)

> Python SDK Worker should log lulls with progress-reporting thread
> -----------------------------------------------------------------
>
>                 Key: BEAM-8333
>                 URL: https://issues.apache.org/jira/browse/BEAM-8333
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-harness
>            Reporter: Pablo Estrada
>            Assignee: Pablo Estrada
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>




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

Reply via email to