Skip to content

Commit 6f9c10d

Browse files
SDK-365 Fix infinite retry loop in ResolverCommand when error is not a file conflict
ResolverCommand.execute() and a_execute() previously retried with the resolver for ANY CopyError/MoveError/RenameError. This caused an infinite loop when the portal returned PermissionDenied (or any non-conflict error) because the retry would immediately fail again with the same error. Now only retries when e.__cause__ is FileConflictError, which is the only case where a resolver can meaningfully resolve the issue. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 932ed19 commit 6f9c10d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cterasdk/cio/core/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,15 +1097,15 @@ def execute(self):
10971097
try:
10981098
return super().execute()
10991099
except (exceptions.io.core.CopyError, exceptions.io.core.MoveError, exceptions.io.core.RenameError) as e:
1100-
if self.resolver:
1100+
if self.resolver and isinstance(e.__cause__, exceptions.io.core.FileConflictError):
11011101
return self._try_with_resolver(e.cursor)
11021102
return self._handle_exception(e)
11031103

11041104
async def a_execute(self):
11051105
try:
11061106
return await super().a_execute()
11071107
except (exceptions.io.core.CopyError, exceptions.io.core.MoveError, exceptions.io.core.RenameError) as e:
1108-
if self.resolver:
1108+
if self.resolver and isinstance(e.__cause__, exceptions.io.core.FileConflictError):
11091109
return await self._a_try_with_resolver(e.cursor)
11101110
return self._handle_exception(e)
11111111

0 commit comments

Comments
 (0)