Kaynağa Gözat

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 ay önce
ebeveyn
işleme
e534332c1a
2 değiştirilmiş dosya ile 15 ekleme ve 0 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 '


Yükleniyor…
İptal
Kaydet