jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1336158?usp=email )

Change subject: sparql: Reset the retry counter for each query
......................................................................

sparql: Reset the retry counter for each query

The retry counter persisted across queries on the same SparqlQuery
instance. A timeout recovered by an earlier query could exhaust the retry
budget for later queries and cause premature ApiTimeoutError exceptions.

Reset the counter when starting each query so the retry limit and backoff
apply independently to each request.

Change-Id: I9fd9c098814433a22234655c75e6043eb6c56f84
---
M pywikibot/data/sparql.py
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/pywikibot/data/sparql.py b/pywikibot/data/sparql.py
index 2dc88ea..41ab131 100644
--- a/pywikibot/data/sparql.py
+++ b/pywikibot/data/sparql.py
@@ -144,6 +144,7 @@

         # force cleared
         self.last_response = None
+        self.current_retries = 0

         url = f'{self.endpoint}?query={quote(query)}'
         while True:

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1336158?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I9fd9c098814433a22234655c75e6043eb6c56f84
Gerrit-Change-Number: 1336158
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to