Skip to content

Commit

Permalink
fix: handle load_session error
Browse files Browse the repository at this point in the history
  • Loading branch information
weekenthralling committed Jun 12, 2024
1 parent d01e84a commit 3f14615
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion enterprise_gateway/services/kernels/remotemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ def check_kernel_id(self, kernel_id: str) -> None:

def _refresh_kernel(self, kernel_id: str) -> bool:
if self.parent.availability_mode == EnterpriseGatewayConfigMixin.AVAILABILITY_REPLICATION:
self.parent.kernel_session_manager.load_session(kernel_id)
try:
self.parent.kernel_session_manager.load_session(kernel_id)
except Exception as e:
self.log.error(f"Failed to load session, kernel_id:{kernel_id}", e)
return False
return self.parent.kernel_session_manager.start_session(kernel_id)
# else we should throw 404 when not using an availability mode of 'replication'
return False
Expand Down

0 comments on commit 3f14615

Please sign in to comment.