From 67c27915ecf733a2e22734e04a88c66057582595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=20L=C3=A9onard?= Date: Wed, 3 Nov 2021 10:16:36 +0100 Subject: [PATCH] feat(s3/retry_open): add comment --- peakina/io/s3/s3_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/peakina/io/s3/s3_utils.py b/peakina/io/s3/s3_utils.py index 9b6ca2e3..ad21ee0b 100644 --- a/peakina/io/s3/s3_utils.py +++ b/peakina/io/s3/s3_utils.py @@ -61,7 +61,11 @@ def _s3_open_file_with_retries(fs, path, retries): return file except Exception as ex: logger.warning(f'could not open {path}', ex) + # if the file has just been uploaded, then it might not be visible immediatly + # but the fail to open has been cached by s3fs + # so, we invalidate the cache fs.invalidate_cache(path) + # and we give some time to S3 to settle the file status sleep(1)