Abacn commented on code in PR #39461:
URL: https://github.com/apache/beam/pull/39461#discussion_r3767250940


##########
sdks/python/apache_beam/io/fileio.py:
##########
@@ -330,6 +350,12 @@ def __call__(self, file_pattern: str) -> 
PollResult[filesystem.FileMetadata]:
                                                   
self._empty_match_treatment)):
       raise BeamIOError(
           'Empty match for pattern %s. Disallowed.' % file_pattern)
+    if self._mtime_timestamps:
+      outputs = [
+          TimestampedValue(metadata, _mtime_timestamp(metadata))
+          for metadata in match_result.metadata_list
+      ]
+      return PollResult.incomplete(outputs).with_watermark(now)
     return PollResult.incomplete(
         match_result.metadata_list, timestamp=now).with_watermark(now)

Review Comment:
   The adjusted logic could have stale watermark slowly updated sources. When a 
poll has no new result, watermark stuck. We have a similar issue for 
PeriodicImpulse: https://github.com/apache/beam/issues/39026
   
   In FileIO.matchContinuously, are the timestamped elements on their mtime, or 
the poll time? This affects how watermark should be handled. My first comment 
assume they were timestamped on mtime, which introduces tricky scenarios. If 
it's actually on poll time, things would be simpler. Just advance watermark to 
now() everytime would suffice.



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