zhuyifei1999 added a comment.

In https://phabricator.wikimedia.org/T125779#1997112, @valhallasw wrote:

> Why do you think this has something to do with OAuth? The log just shows 
> pywikibot retrying after the API returns a 'badtoken' response, as it's 
> supposed to. I'm not sure why it's continuously failing, but that might have 
> something to do with the multithreaded nature of your bot (two threads get a 
> token, one uses them, the other gets a badtoken response).


Well, you cannot get an valid crsf token from an invalid oauth token. And no, 
multiprocessing should be irrelevant, as none of the upload attempts succeeded 
(the token being consumed). Even when only one process working, the same issues 
happen as well:

P2563 repeated bad crsf loop <https://phabricator.wikimedia.org/P2563>

All upload attempts after this failed. However, it used to work anyways:

  [2016-01-28 18:50:27,038: WARNING/Worker-14] -1: Configuring Pywikibot...
  [2016-01-28 18:50:27,061: VERBOSE/Worker-14] Found 1 commons:commons 
processes running, including this one.
  [2016-01-28 18:50:27,120: INFO/Worker-14] Starting new HTTPS connection (1): 
commons.wikimedia.org
  [2016-01-28 18:50:27,358: WARNING/Worker-14] -1: Uploading...
  [2016-01-28 18:50:27,374: WARNING/Worker-14] -1: Uploading...
  [2016-01-28 18:50:27,905: INFO/Worker-14] Sleeping for 9.2 seconds, 
2016-01-28 18:50:27
  [2016-01-28 18:51:11,702: INFO/Worker-14] Upload successful.
  [2016-01-28 18:51:11,758: WARNING/Worker-14] 100: Upload success!
  [2016-01-28 18:51:11,762: WARNING/Worker-14] -1: Cleaning up...
  [2016-01-28 18:51:11,875: WARNING/Worker-14] 100: Done!

And two processes uploading at the same time had happened and succeeded, though 
I can't find the entries in these 200M log

In case it's confusing, this in not really multithreading, but multiprocessing 
via os.fork():
P2562 celerey workers on encoding01 <https://phabricator.wikimedia.org/P2562>


TASK DETAIL
  https://phabricator.wikimedia.org/T125779

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: zhuyifei1999
Cc: valhallasw, Ricordisamoa, Aklapper, Yann, StudiesWorld, 
pywikibot-bugs-list, zhuyifei1999



_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to