Page MenuHomePhabricator

makecat uses http on import, causing deadlock
Closed, ResolvedPublic

Description

makecat has its main loop at the module level, rather than in a function main() like other scripts.

This causes a deadlock in handleArgs while trying to fetch the live API version.


Version: core-(2.0)
Severity: major

Details

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:28 AM
bzimport set Reference to bz69781.
bzimport added a subscriber: Unknown Object (????).

Change 155231 had a related patch set uploaded by John Vandenberg:
Add main() to makecat

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

Gallaecio set Security to None.
Gallaecio removed a subscriber: Unknown Object (????).

Change 216407 had a related patch set uploaded (by John Vandenberg):
Deadlock problem fixed by using requests

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

The makecat problem has indirectly been fixed by T98439. The problem still exists on the 2.0 branch, and T87742 tracks the problem occurring in calling code.

How does having it not in main() cause a deadlock?

The problem was the sequence of actions used to set up the threads and such. @valhallasw had a very nice graph of the import sequence which shows how the deadlock occurs, which I stumble across occasionally but can never find when I want it. :/

Putting code in main() means all imports complete before main starts.

Change 216407 merged by jenkins-bot:
Deadlock problem fixed by using requests

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