Browse Source

Disable HTTP connection pooling

Disable HTTP connection pooling by asking HTTP server to close our
connection right upon use. The rationale is that some BMC observed in
the wild seem to close persistent connections abruptly upon eventual
re-use failing completely unrelated operation. So in ``sushy`` we
just try not to maintain persistent connections with BMC at all.

Story: 2006336
Task: 36084

Change-Id: I721c6284b938d5a47dbe0b298467c15ca4bd1517
(cherry picked from commit 84e085f9a2460218bf52315a21ee4dcf8365e3e1)
tags/1.3.4^0
Ilya Etingof Julia Kreger 7 months ago
parent
commit
efadfc7620
2 changed files with 15 additions and 0 deletions
  1. +8
    -0
      releasenotes/notes/disable-conn-pooling-3456782afe56ac94.yaml
  2. +7
    -0
      sushy/connector.py

+ 8
- 0
releasenotes/notes/disable-conn-pooling-3456782afe56ac94.yaml View File

@@ -0,0 +1,8 @@
---
fixes:
- |
Disable HTTP connection pooling by asking HTTP server to close our
connection right upon use. The rationale is that some BMC observed in
the wild seem to close persistent connections abruptly upon eventual
re-use failing completely unrelated operation. So in ``sushy`` we
just try not to maintain persistent connections with BMC at all.

+ 7
- 0
sushy/connector.py View File

@@ -31,6 +31,13 @@ class Connector(object):
self._verify = verify
self._session = requests.Session()
self._session.verify = self._verify

# NOTE(etingof): field studies reveal that some BMCs choke at
# long-running persistent HTTP connections (or TCP connections).
# By default, we ask HTTP server to shut down HTTP connection we've
# just used.
self._session.headers['Connection'] = 'close'

if username or password:
LOG.warning('Passing username and password to Connector is '
'deprecated. Authentication is passed through '


Loading…
Cancel
Save