From c176da19a62ad607fc8763a2990ad7fc39454e05 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= <sybren@stuvel.eu>
Date: Thu, 14 Feb 2019 12:44:21 +0100
Subject: [PATCH] Remove filtering of Cycles 'Synchronizing object' lines

Nowadays we send the logs only to the Manager, and not to the Server any
more. Let's clog the Manager's harddisk with everything to make Dr. Debug
happier.
---
 flamenco_worker/commands.py           | 19 -------------------
 tests/test_commands_blender_render.py | 11 -----------
 2 files changed, 30 deletions(-)

diff --git a/flamenco_worker/commands.py b/flamenco_worker/commands.py
index 4f14095a..69e2cafb 100644
--- a/flamenco_worker/commands.py
+++ b/flamenco_worker/commands.py
@@ -720,14 +720,6 @@ class AbstractBlenderCommand(AbstractSubprocessCommand):
     re_status = attr.ib(init=False)
     re_path_not_found = attr.ib(init=False)
     re_file_saved = attr.ib(init=False)
-
-    # These lines are produced by Cycles (and other rendering engines) for each
-    # object, choking the Manager with logs when there are too many objects.
-    # For now we have some custom code to swallow those lines, in lieu of a
-    # logging system that can handle those volumes properly.
-    substring_synchronizing = {'| Synchronizing object |', ' | Syncing '}
-    seen_synchronizing_line = False
-
     _last_activity_time: float = 0.0
 
     def __attrs_post_init__(self):
@@ -842,10 +834,6 @@ class AbstractBlenderCommand(AbstractSubprocessCommand):
 
         return info
 
-    def _is_sync_line(self, line: str) -> bool:
-        return any(substring in line
-                   for substring in self.substring_synchronizing)
-
     async def process_line(self, line: str) -> typing.Optional[str]:
         """Processes the line, returning None to ignore it."""
 
@@ -853,13 +841,6 @@ class AbstractBlenderCommand(AbstractSubprocessCommand):
         if 'Warning: Unable to open' in line or self.re_path_not_found.search(line):
             await self.worker.register_task_update(activity=line)
 
-        if self._is_sync_line(line):
-            if self.seen_synchronizing_line:
-                return None
-            self.seen_synchronizing_line = True
-            return '> %s  (NOTE FROM WORKER: only logging this line; skipping the rest of ' \
-                   'the Synchronizing Objects lines)' % line
-
         render_info = self.parse_render_line(line)
         now = time.time()
         # Only update render info every this many seconds, and not for every line Blender produces.
diff --git a/tests/test_commands_blender_render.py b/tests/test_commands_blender_render.py
index 0dc89dfe..1deee3d1 100644
--- a/tests/test_commands_blender_render.py
+++ b/tests/test_commands_blender_render.py
@@ -32,17 +32,6 @@ class BlenderRenderTest(AbstractCommandTest):
             'hunds': '17',
         })
 
-    def test_is_sync_line(self):
-        # Cycles
-        line = 'Fra:116 Mem:2348.62M (0.00M, Peak 2562.33M) | Time:02:31.54 | Mem:0.00M, ' \
-               'Peak:0.00M | 02_005_A.lighting, R-final ' \
-               '| Synchronizing object | GEO-frost_particle.007'
-        self.assertTrue(self.cmd._is_sync_line(line))
-
-        # Non-cycles (render engine set to Cycles without Cycles support in Blender).
-        line = 'Fra:1 Mem:67.05M (0.00M, Peak 98.78M) | Time:00:00.17 | Syncing Suzanne.003'
-        self.assertTrue(self.cmd._is_sync_line(line))
-
     def test_parse_render_line(self):
         line = 'Fra:10 Mem:17.52M (0.00M, Peak 33.47M) | Time:00:04.17 | Remaining:00:00.87 | ' \
                'Mem:1.42M, Peak:1.42M | Scene, RenderLayer | Path Tracing Tile 110/135'
-- 
GitLab