Postgresql Database Error
Mike McLean
mikem at redhat.com
Wed Nov 18 13:56:59 UTC 2009
On 11/18/2009 02:15 AM, peng chen wrote:
> hello, fedora-buildsys-list:
>
> when I requset a build task for pakcage "anaconda" to koji,
> one errie error come out.
> It detailed as follow:
> pg.DatabaseError: error ' ERROR: new row for relation "task" violates
> check constraint "task_weight_check" '
> in ' UPDATE task SET weight=-0.9838856091396 WHERE id = 16296 '
> I'm sure that the source rpm of anaconda is OK,because I succed to build
> it in local mock environment. and
> the repo is the same as the koji build server.
> hope you do me a favor sincerely!
The system time on your hub must have been set back during an anaconda
build and there must be sufficiently few anaconda builds for this to
cause getAverageBuildDuration('anaconda') to return a negative number.
We should of course fix this, but you should also avoid rolling back the
time on your koji hosts, especially the hub and db hosts.
In the meantime, this patch should help
--- a/builder/kojid
+++ b/builder/kojid
@@ -2033,6 +2033,9 @@ class BuildArchTask(BaseTaskHandler):
avg = session.getAverageBuildDuration(name)
if not avg:
return
+ if avg < 0:
+ self.logger.warn("Negative average build duration for %s:
%s", name, avg)
+ return
# increase the task weight by 0.75 for every hour of build
duration
adj = (avg / 4800.0)
# cap the adjustment at +4.5
More information about the buildsys
mailing list