[Buildbot-devel] IntegrityError on postgresql, "claimed_at" violates not-null constraint

Benoît Allard benoit at aeteurope.nl
Fri Sep 21 14:37:25 UTC 2012



> -----Original Message-----
> From: djmitche at gmail.com [mailto:djmitche at gmail.com] On Behalf Of Dustin J.
> Mitchell
> Sent: Friday, September 21, 2012 2:31 PM
> To: Benoît Allard
> Cc: BuildBot Devel (buildbot-devel at lists.sourceforge.net)
> Subject: Re: [Buildbot-devel] IntegrityError on postgresql, "claimed_at"
> violates not-null constraint
> 
> On Fri, Sep 21, 2012 at 5:53 AM, Benoît Allard <benoit at aeteurope.nl> wrote:
> > Does someone already has a fix in the pipeline for this ?
> 
> I haven't heard of this *specific* problem before.  I also don't see
> how it can happen:
> 
> 102         if claimed_at is not None:
> 103             claimed_at = datetime2epoch(claimed_at)
> 104         else:
> 105             claimed_at = _reactor.seconds()

I've seen those lines, yet, I've seen my logs ... Some preconditions over here are not meet ... I could add some logging (and I will), I'm just not sure where ...

We could probably figure out why this claimed_at is 'null' (not None, 'null'), and prevent it to happen again, but yet, that's just asking for the next integrity error to show ...

> 
> The problem of catching exceptions is tricky - we can't match on
> message text, as it can be localized.  And SQLAlchemy isn't very
> specific in breaking db errors down to exceptions.

I imagine querying before inserting (to check if the request is not already claimed) is not an option, right ? What if we do that inside a transaction ? Oh wait, the transaction is already there ... What's the problem then ?

> 
> We can add an assert that claimed_at is not None, but I'm not sure
> that will help.

I don't think this will help either ...

Regards,
Benoît.

(I guess this error explains the trouble of builds being queued, and never scheduled despite the slave being idle)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6467 bytes
Desc: not available
URL: <http://buildbot.net/pipermail/devel/attachments/20120921/b67db276/attachment.bin>


More information about the devel mailing list