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

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

                Author: ASF GitHub Bot
            Created on: 06/Oct/18 01:15
            Start Date: 06/Oct/18 01:15
    Worklog Time Spent: 10m 
      Work Description: rakeshcusat commented on a change in pull request 
#6593: [BEAM-5633] Adds reconnect logic to python logging client
URL: https://github.com/apache/beam/pull/6593#discussion_r223167079
 
 

 ##########
 File path: sdks/python/apache_beam/runners/worker/log_handler.py
 ##########
 @@ -108,5 +113,16 @@ def _write_log_entries(self):
 
   def _read_log_control_messages(self, log_control_iterator):
     # TODO(vikasrk): Handle control messages.
-    for _ in log_control_iterator:
-      pass
+    while True:
+      try:
+        for _ in log_control_iterator:
+          pass
+        # iterator is closed
+        return
+      except Exception as ex:
+        # reset the stream
+        print >> sys.stderr, "Logging client failed: {}... 
resetting".format(ex)
 
 Review comment:
   ```
   print("Logging client failed: {}... resetting".format(ex), file=sys.stderr)
   ```
   If you want to print the stack trace then syntax could be little different.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 151938)
    Time Spent: 50m  (was: 40m)

> Python SDK harness logging client failure
> -----------------------------------------
>
>                 Key: BEAM-5633
>                 URL: https://issues.apache.org/jira/browse/BEAM-5633
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-harness
>            Reporter: Thomas Weise
>            Assignee: Micah Wylde
>            Priority: Major
>              Labels: portability-flink
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> After running a test with synthetic source for a few minutes, the logging 
> client fails and all subsequent log output is not forwarded to the runner.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to