[Twisted-Python] are there known ssl/threading/socket issues with httplib2/httplib and Twisted ?

Jonathan Vanasco twisted-python at 2xlp.com
Wed Sep 17 19:31:16 MDT 2014


Background:
	I'm using a 3rd party API client, which uses httplib2 in the internals.  ( the google-plus api )
	I'm placing this blocking code within a DeferredList, that runs within a twisted.enterprise.adbapi.ConnectionPool.runInteraction

In my initial tests, everything worked fine -- but I was only making a single GET/POST, as I kept the size of the DeferredList to 1 while I worked on the code.

As soon as I increased the limit and had 2 GET/POST events firing off at the same time, I started getting a ssl/socket error   ( httplib2 > httplib > socket > ssl ).

It works fine in twisted if I make simultaneous requests otherwise (using twisted or the `requests` package).  this seems to be tied to how httplib2/httplib is running within twisted.

Has anyone experienced this before?  if so, do you know if there is a workaround?

The easiest fix, is probably for me to write a new ApiClient tomorrow for the methods I need.  I'd just like to avoid that if possible


More information about the Twisted-Python mailing list