Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
Fix replica conflict errors and optimize screenshot worker DB calls (#4651)
Shuchang Zheng32444429fd73
diff --git a/skyvern/forge/sdk/db/base_alchemy_db.py b/skyvern/forge/sdk/db/base_alchemy_db.pyindex 5153e8d98..91cbb6179 100644--- a/skyvern/forge/sdk/db/base_alchemy_db.py+++ b/skyvern/forge/sdk/db/base_alchemy_db.py@@ -96,4 +96,17 @@ class _SessionFactory:yield sessionfinally:self._session_ctx.reset(token)- await session.close()+ try:+ await session.close()+ except SQLAlchemyError as e:+ # Handle transient errors during session cleanup gracefully.+ # This can happen on replicas when the connection is terminated due to+ # WAL replay conflicts. Since the actual DB operation already completed+ # successfully (we're in finally block cleanup), we just log and continue.+ if self._db.is_retryable_error(e):+ LOG.warning(+ "Transient error during session close (suppressed)",+ error=str(e),+ )+ else:+ raise