GothenburgBitFactory / bugwarrior

Pull github, bitbucket, and trac issues into taskwarrior
http://pypi.python.org/pypi/bugwarrior
GNU General Public License v3.0
743 stars 208 forks source link

Detect when UDD has high load and won't process requests #366

Closed irl closed 2 years ago

irl commented 8 years ago

When UDD has high load, it will return HTML instead of JSON with an error message. Incorrect content type should be caught and the sync should be cleanly aborted. Currently it's aborted, but with a horrible looking traceback (due to the JSON not parsing).

I haven't seen other plugins doing any caching, but it might be worthwhile to cache the results of the UDD lookup as this is just discovering packages that are of interest to the developer, and changes do not need to necessarily be reflected immediately. If the same result as last time could be used instead, the same search would be performed against BTS and while new packages might be missed, everything else will work correctly.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 2607:f8f0:610:4000:6564:a62:ce0c:138d...
* Connected to udd.debian.org (2607:f8f0:610:4000:6564:a62:ce0c:138d) port 443 (#0)
* found 175 certificates in /etc/ssl/certs/ca-certificates.crt
* found 704 certificates in /etc/ssl/certs
* ALPN, offering h2
* ALPN, offering http/1.1
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: udd.debian.org (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: OU=Domain Control Validated,OU=Gandi Standard SSL,CN=udd.debian.org
*    start date: Fri, 11 Dec 2015 00:00:00 GMT
*    expire date: Fri, 30 Dec 2016 23:59:59 GMT
*    issuer: C=FR,ST=Paris,L=Paris,O=Gandi,CN=Gandi Standard SSL CA 2
*    compression: NULL
* ALPN, server did not agree to a protocol
> GET /bugs/bugs/?release=stretch_and_sid&patch=ign&merged=ign&done=ign&fnewerval=7&rc=1&sortby=id&sorto=asc&ctags=1&ctags=1&cdeferred=1 HTTP/1.1
> Host: udd.debian.org
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Mon, 08 Aug 2016 12:51:37 GMT
< Server: Apache
< Strict-Transport-Security: max-age=15552000
< Vary: Accept-Encoding
< X-Clacks-Overhead: GNU Terry Pratchett
< Transfer-Encoding: chunked
< Content-Type: text/html
< 
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0{ [556 bytes data]
100   551    0   551    0     0    320      0 --:--:--  0:00:01 --:--:--   320
* Connection #0 to host udd.debian.org left intact
<p><b>Current system load (21.6) is too high. Please retry later!</b></p>
<pre>select id, bugs.package, bugs.source, severity, title, last_modified, affects_stable, affects_testing, affects_unstable, affects_experimental from bugs 
where id in (select id from bugs_rt_affects_testing) and id in (select id from bugs_rt_affects_unstable) 
and not (id in (select id from bugs_tags where tag='patch')) 
and not (id in (select id from bugs_merged_with where id > merged_with)) 
and not (status = 'done') 
AND (severity >= 'serious')
order by id asc</pre>
ryneeverett commented 2 years ago

I'm going to close this for now as it addresses a pretty specific need that only one community member has reported and no longer intends to implement. Of course, we'd be happy to reopen this if it becomes relevant again.