Skip to content

Commit 8fc1e9b

Browse files
authored
fix: ignore RuntimeError for shared workspace double recovery (#1140)
* fix: ignore RuntimeError for shared workspace double recovery * add print
1 parent be73f63 commit 8fc1e9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

rdagent/core/experiment.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,12 @@ def recover_ws_ckp(self) -> None:
439439
self.experiment_workspace.recover_ws_ckp()
440440
for ws in self.sub_workspace_list:
441441
if ws is not None:
442-
ws.recover_ws_ckp()
442+
try:
443+
ws.recover_ws_ckp()
444+
except RuntimeError:
445+
# the FBWorkspace is shared between experiment_workspace and sub_workspace_list,
446+
# so recover_ws_ckp will raise RuntimeError if a workspace is recovered twice.
447+
print("recover_ws_ckp failed due to one workspace is recovered twice.")
443448

444449

445450
ASpecificExp = TypeVar("ASpecificExp", bound=Experiment)

0 commit comments

Comments
 (0)