Page MenuHomePhabricator

LockableCookieJar: double locking
Closed, ResolvedPublic

Description

LockableCookieJar has only one feature: self.lock is a threading.Lock()

cookielib.LWPCookieJar (verified in py2.6) also has a lock: self._cookies_lock = _threading.RLock()

As threadedhttp threads do not re-enter the two cookiejar parts of the request method, I fail to see how _threading.RLock() is not sufficient.

If an RLock is sufficient, this class can be removed, and therefore doesnt need to be considered for alternative http clients. (e.g. T98439).

If a proper Lock is needed, more documentation is needed, and add_cookie_header and extract_cookies methods should be subclassed so that the locking is encapsulated within the class.

Details

Related Changes in Gerrit:

Event Timeline

jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)
jayvdb added subscribers: jayvdb, valhallasw.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMay 9 2015, 12:49 PM

Change 209963 had a related patch set uploaded (by John Vandenberg):
Remove LockableCookieJar

https://gerrit.wikimedia.org/r/209963

Change 209963 merged by jenkins-bot:
Remove LockableCookieJar

https://gerrit.wikimedia.org/r/209963

jayvdb claimed this task.