You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# If async delete fails or times out, try using sync connection instead
624
-
# This often works because the sync connection can delete tables it has access to
625
-
# and won't conflict with itself
626
-
ifisinstance(e, asyncio.TimeoutError):
627
-
logger.warning(f"Async delete timed out for {table_name}, trying sync delete as fallback")
628
-
else:
629
-
logger.warning(f"Async delete failed for {table_name}: {e}, trying sync delete as fallback")
630
-
try:
631
-
# Use sync connection to delete (it may have better access and won't conflict)
632
-
withself._conn.cursor() ascur:
633
-
cur.execute(f'DROP TABLE IF EXISTS "{table_name}" CASCADE')
634
-
self._conn.commit()
635
-
logger.info(f"Successfully deleted workspace table {table_name} using sync connection")
636
-
exceptExceptionassync_error:
637
-
error_msg=f"Both async and sync delete failed for workspace {workspace_id} (table: {table_name}). The table may be locked by another connection. Async error: {e}, Sync error: {sync_error}"
638
-
logger.error(error_msg)
639
-
raiseTimeoutError(error_msg) frome
640
-
exceptExceptionase:
641
-
logger.error(f"Failed to delete workspace {workspace_id} (table: {table_name}): {e}")
642
-
importtraceback
643
-
logger.error(traceback.format_exc())
644
-
raise
581
+
logger.debug(f"Attempting to delete workspace table: {table_name}")
582
+
conn=awaitself._get_async_conn()
583
+
logger.debug(f"Connection established, executing DROP TABLE for {table_name}")
584
+
awaitconn.execute(f'DROP TABLE IF EXISTS "{table_name}" CASCADE')
0 commit comments