Skip to content

Commit

Permalink
Merge pull request #1522 from djmitche/fix-postgres-error
Browse files Browse the repository at this point in the history
after failure to insert, re-start the transaction before updating
  • Loading branch information
Mikhail Sobolev committed Feb 3, 2015
2 parents bf3fa43 + 7932789 commit 5055f55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions master/buildbot/db/schedulers.py
Expand Up @@ -41,6 +41,8 @@ def thd(conn):
important=imp_int)
except (sqlalchemy.exc.ProgrammingError,
sqlalchemy.exc.IntegrityError):
transaction.rollback()
transaction = conn.begin()
# insert failed, so try an update
conn.execute(upd_q,
wc_changeid=changeid,
Expand Down

0 comments on commit 5055f55

Please sign in to comment.