2009/4/24 russblau@svn.wikimedia.org:
When server is under heavy load, it may time out (http code 504) on API queries with high limits; this revision lets QueryGenerator instances catch these errors, lower the query limit, and retry.
That's an interesting change, because those 504 happen quite often =)
#TODO: do some error correcting stuff
- if request.data[0].status == 504:
- raise Server504Error("Server %s timed out" % site.hostname())
This, however, doesn't seem to work as expected. From time to time, I get some tracebacks :
ERROR: Traceback (most recent call last): File "/home/nicdumz/pywikipedia/pywikibot/data/api.py", line 189, in submit body=params) File "/home/nicdumz/pywikipedia/pywikibot/comms/http.py", line 102, in request if request.data[0].status == 504: AttributeError: 'int' object has no attribute 'status'
WARNING: Waiting 5 seconds before retrying.
But it's nothing critical, because the error is caught, and the query is sent again.
You Speak Türkish?
From: nicdumz@gmail.com Date: Sun, 26 Apr 2009 01:07:30 +0900 To: pywikipedia-l@lists.wikimedia.org Subject: Re: [Pywikipedia-l] [Pywikipedia-svn] SVN: [6685] branches/rewrite/pywikibot
2009/4/24 russblau@svn.wikimedia.org:
When server is under heavy load, it may time out (http code 504) on API queries with high limits; this revision lets QueryGenerator instances catch these errors, lower the query limit, and retry.
That's an interesting change, because those 504 happen quite often =)
#TODO: do some error correcting stuff
- if request.data[0].status == 504:
raise Server504Error("Server %s timed out" % site.hostname())
This, however, doesn't seem to work as expected. From time to time, I get some tracebacks :
ERROR: Traceback (most recent call last): File "/home/nicdumz/pywikipedia/pywikibot/data/api.py", line 189, in submit body=params) File "/home/nicdumz/pywikipedia/pywikibot/comms/http.py", line 102, in request if request.data[0].status == 504: AttributeError: 'int' object has no attribute 'status'
WARNING: Waiting 5 seconds before retrying.
But it's nothing critical, because the error is caught, and the query is sent again.
-- Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-
_________________________________________________________________ Sürükle ve Bırak: Windows Live™ Photos ile fotoğraflarınızı kolayca paylaşımı. http://www.microsoft.com/windows/windowslive/products/photos.aspx
On Sat, April 25, 2009 6:07 pm, Nicolas Dumazet wrote:
ERROR: Traceback (most recent call last): File "/home/nicdumz/pywikipedia/pywikibot/data/api.py", line 189, in submit body=params) File "/home/nicdumz/pywikipedia/pywikibot/comms/http.py", line 102, in request if request.data[0].status == 504: AttributeError: 'int' object has no attribute 'status'
WARNING: Waiting 5 seconds before retrying.
But it's nothing critical, because the error is caught, and the query is sent again.
Actually, it is, but not because of the exception ;) That AttributeError is a programming error, and if it is being caught, that means there is some try-except-block catching exceptions it shouldn't be catching...
Although I have to agree this is less annoying than the bot crashing.
--valhallasw
Merlijn van Deen wrote:
On Sat, April 25, 2009 6:07 pm, Nicolas Dumazet wrote:
File "/home/nicdumz/pywikipedia/pywikibot/comms/http.py",
line 102,
in request if request.data[0].status == 504: AttributeError: 'int' object has no attribute 'status'
WARNING: Waiting 5 seconds before retrying.
But it's nothing critical, because the error is caught, and
the query
is sent again.
Actually, it is, but not because of the exception ;) That AttributeError is a programming error, and if it is being caught, that means there is some try-except-block catching exceptions it shouldn't be catching...
Although I have to agree this is less annoying than the bot crashing.
--valhallasw
r6720 attempted to address this. Please let me know if the bug occurs again.
Russ
pywikipedia-l@lists.wikimedia.org