[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][snapshot-team/snapshot][master] 2 commits: Add PoolError to the list of error to recover from on close



Title: GitLab

Julien Cristau pushed to branch master at snapshot / snapshot

Commits:

  • 1160d9c7
    by Baptiste Beauplat at 2022-09-28T19:32:02+02:00
    Add PoolError to the list of error to recover from on close
    
    This particular error case was previously hidden by the ROLLBACK statement
    failing first when the connection was closed. Since it has been removed
    to avoid rollback on non-transactional queries, updating the exception
    list to recover from with PoolError.
    
  • 370be955
    by Julien Cristau at 2022-09-28T17:55:44+00:00
    Merge branch 'fix/rollback-outside-transaction' into 'master'
    
    Add PoolError to the list of error to recover from on close
    
    See merge request snapshot-team/snapshot!6

1 changed file:

Changes:

  • web/app/snapshot/lib/dbinstance.py
    ... ... @@ -99,7 +99,8 @@ class DBInstance:
    99 99
         def close(self):
    
    100 100
             try:
    
    101 101
                 self.pool.putconn(self.conn)
    
    102
    -        except (psycopg2.OperationalError, psycopg2.InterfaceError):
    
    102
    +        except (psycopg2.OperationalError, psycopg2.InterfaceError,
    
    103
    +                psycopg2.pool.PoolError):
    
    103 104
                 # Excluding from coverage (see above)
    
    104 105
                 if not self.conn.closed:  # pragma: no cover
    
    105 106
                     self.pool.putconn(self.conn, close=True)


  • Reply to: