Skip to content

Commit 69aff1e

Browse files
authored
Limit the filename in 255 characters (#226)
1 parent d2245cd commit 69aff1e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

outsource/submitter.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,12 @@ def add_higher_processing_job(
529529
_key = "-".join(
530530
[dbcfg._run_id] + [f"{d}-{dbcfg.key_for(d).lineage_hash}" for d in data_types]
531531
)
532+
# Sometimes the filename can be too long
533+
if len(_key) > 255 - len("untar--output.tar.gz.log"):
534+
self.logger.warning(f"Filename {_key} is too long, will not include hash in it.")
535+
_key = "-".join([dbcfg._run_id] + list(data_types))
536+
if len(_key) > 255 - len("untar--output.tar.gz.log"):
537+
raise RuntimeError(f"Filename {_key} is still too long.")
532538
job_tar = File(f"{_key}-output.tar.gz")
533539

534540
# Add job

0 commit comments

Comments
 (0)