瀏覽代碼

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.6.1^0
Ilya Etingof Julia Kreger 10 月之前
父節點
當前提交
e534332c1a
共有 2 個檔案被更改,包括 15 行新增0 行删除
  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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存