/srv/irclogs.ubuntu.com/2015/03/11/#launchpad-dev.txt

cjwatsonwgrant: Ugh, doing a proper whole-request timeout with requests manages to be even more of a nightmare than it is with urllib2.10:02
wgrantcjwatson: ... srsly?10:08
cjwatsonThe sock.shutdown dance is still needed, AFAICS, and it's incredibly hard to pick through the layers to get at the actual socket.10:08
wgrantHow is this not something that everyone wants :(10:09
cjwatsonThe response object isn't initialised until after the first recv, so a naïve attempt hangs in lp.services.tests.test_timeout.TestTimeout.test_urlfetch_timeout_after_listen.10:09
cjwatsonSee https://github.com/kennethreitz/requests/issues/239#issuecomment-22233420 and cry10:09
cjwatsonI'm seriously tempted to switch it over to using a subprocess rather than a thread so that we can just abruptly kill the thing.10:10
wgrantHeh :/10:10
wgrantrequests is meant to be the sane thing to use :(10:11
wgrantI began to doubt that while trying to work out how to, you know, close its connections.10:11
wgrantAnd failing.10:11
wgrantOh10:12
wgrantThat very issue, in fact :/10:12
cjwatsonThe only other decent idea I have so far is to pick through the urllib3 connection pool and forcibly close everything in it.10:12
wgrantI think I tried that but gave up.10:13
cjwatsonBut I think we have to fix this before using GitHostingClient much more ...10:13
wgrantThat may have just been because I was immensely frustrated with the ongoing production incident, rather than because it was fundamentally too difficult.10:13
cjwatsonMaybe if I subclass stuff all the way down.10:16
cjwatsonSubclass HTTPConnectionPool etc. so that I can customise its actual pool and add code to clean it up properly; subclass PoolManager to use my modified HTTPConnectionPool; subclass requests.adapters.HTTPAdapter to use my modified PoolManager10:18
cjwatsonIt might actually be possible with only the advertised API.10:18
cjwatsonBut seriously.10:19
wgrantYup.10:28
wgrantAt least we don't have an ongoing production outage because of it this time!10:28
cjwatsonWas that with swift?10:31
cjwatsonOh god I'm going to have to subclass Queue.LifoQueue somehow.10:31
wgrantRight, the librarian EMFILE incident with Swift connections hanging around.10:33
cjwatsonOMG I think this foul contraption might work.11:31
wgrantI don't believe you.11:32
cjwatsonwgrant: https://code.launchpad.net/~cjwatson/launchpad/timeout-with-requests/+merge/252570 - I think it's still a net improvement to be able to use other parts of requests, but ugh12:18
cjwatsonReassuring that the tests caught my early insufficient attempts, at least.12:21

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!