[Buildbot-devel] db.schedulers.classifyChanges relies on integrity check

Harry Borkhuis harry at aeteurope.nl
Wed May 23 14:25:07 UTC 2012


Today I reconfigured buildbot (renamed schedulers) while there where some changes waiting for the treeStableTimer., there are some changes awaiting in the database.

 
Now the reconfiguration does not succeed as an internal error occurs during the creation of the scheduler:

The stacktrace in the buildbot.log contains an error "(InternalError) current transaction is aborted, commands ignored until end of transaction block"

The last buildbot source in this stacktrace is at File "/home/buildmaster/buildbot/buildbot-latest-mr-gui/master/buildbot/db/schedulers.py", line 45

The statement that follows looks good:

UPDATE scheduler_changes SET important=%(important)s WHERE scheduler_changes.objectid = %(objectid_1)s AND scheduler_changes.changeid = %(wc_changeid)s'

     {'wc_changeid': 934, 'important': 1, 'objectid_1': 39}

 
The error occurs in db.schedulers.classifyChanges. This method relies on the integrity check of the database. When an insert does not succeed then an update is performed. 

 
Looking in the postgres logging  I see a lot of unsuccessful Inserts + successful update couples.

This is what I see in the postgress logging... 

 
2012-05-23 13:33:20 CEST STATEMENT:  INSERT INTO scheduler_changes (objectid, changeid, important) VALUES (55, 934, 1)

2012-05-23 13:33:20 CEST ERROR:  duplicate key value violates unique constraint "scheduler_changes_unique"

2012-05-23 13:33:20 CEST STATEMENT:  INSERT INTO scheduler_changes (objectid, changeid, important) VALUES (44, 934, 1)

2012-05-23 13:33:20 CEST ERROR:  current transaction is aborted, commands ignored until end of transaction block

2012-05-23 13:33:20 CEST STATEMENT:  UPDATE scheduler_changes SET important=1 WHERE scheduler_changes.objectid = 44 AND scheduler_changes.changeid = 934

2012-05-23 13:33:20 CEST ERROR:  duplicate key value violates unique constraint "scheduler_changes_unique"

 
I doubt if the 'UPDATE' is really causing the error as this update can never cause an duplicate key error. I think that an Insert goes wrong but that the error is seen during the update.

 
Did anyone see this before??

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20120523/00cbdffd/attachment.html>


More information about the devel mailing list