tvalentyn commented on code in PR #31581:
URL: https://github.com/apache/beam/pull/31581#discussion_r1637164609


##########
sdks/python/apache_beam/runners/worker/data_plane.py:
##########
@@ -639,8 +639,13 @@ def _write_outputs(self):
       streams = [self._to_send.get()]
       try:
         # Coalesce up to 100 other items.
+        total_size_bytes = 0
         for _ in range(100):
-          streams.append(self._to_send.get_nowait())
+          data_or_timer = self._to_send.get_nowait()
+          total_size_bytes += data_or_timer.ByteSize()
+          streams.append(data_or_timer)
+          if total_size_bytes > _DEFAULT_SIZE_FLUSH_THRESHOLD:

Review Comment:
   could also use a larger value here.
   
   -  2*_DEFAULT_SIZE_FLUSH_THRESHOLD (since we collect Data and Timers but 
then separate them in different streams)
   - XXX MB
   



-- 
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]

Reply via email to