Skip to content

Commit 4f5366a

Browse files
authored
fix: do not allow retries when testing SFTP connections (#896)
Closes #894.
1 parent 69bc805 commit 4f5366a

File tree

1 file changed

+9
-2
lines changed
  • components/renku_data_services/storage

1 file changed

+9
-2
lines changed

components/renku_data_services/storage/rclone.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,19 @@ async def test_connection(
6969
config = "\n".join(f"{k}={v}" for k, v in transformed_config.items())
7070
f.write(f"[temp]\n{config}")
7171
f.close()
72-
proc = await asyncio.create_subprocess_exec(
73-
"rclone",
72+
args = [
7473
"lsf",
7574
"--config",
7675
f.name,
7776
f"temp:{source_path}",
77+
]
78+
# Handle SFTP retries, see https://github.com/SwissDataScienceCenter/renku-data-services/issues/893
79+
storage_type = cast(str, configuration.get("type"))
80+
if storage_type == "sftp":
81+
args.extend(["--low-level-retries", "1"])
82+
proc = await asyncio.create_subprocess_exec(
83+
"rclone",
84+
*args,
7885
stdout=asyncio.subprocess.PIPE,
7986
stderr=asyncio.subprocess.PIPE,
8087
)

0 commit comments

Comments
 (0)