build_job() is failing with "... empty response" exception when Jenkins is behind haproxy where disabled keep_alive
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Jenkins |
Fix Released
|
Undecided
|
Dennis Dmitriev |
Bug Description
Jenkins supports keep_alive http option, and when JenkinsClient:
ipdb> response.
201
ipdb> response.headers
{'Date': 'Mon, 04 Jun 2018 11:52:00 GMT', 'Content-Length': '0', 'Location': 'http://
But if Jenkins master is behind HAProxy with enabled 'option httpclose', which disables keep_alive, the response doesn't contain 'content-length' header:
ipdb> response.
201
ipdb> response.headers
{'Date': 'Mon, 04 Jun 2018 11:55:36 GMT', 'Connection': 'close', 'Location': 'http://
Other fields that are checked in JenkisClient:
ipdb> response.content
''
ipdb> response.text
u''
As the result: JenkinsClient raises an exception like:
File ".../local/
'POST', self.build_
File ".../lib/
self.
File ".../lib/
"empty response" % self.server)
jenkins.
However, the response is valid because the meaningful part of the response is the header 'Location'.
Fix proposed to branch: master /review. openstack. org/572179
Review: https:/