Skip to content

Commit a36f64a

Browse files
committed
fix(opensearch): set pool_maxsize so the shared client keeps a real connection pool
1 parent 7789862 commit a36f64a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

rag/utils/opensearch_conn.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,16 @@ def __init__(self):
7373
http_auth=(settings.OS["username"], settings.OS[
7474
"password"]) if "username" in settings.OS and "password" in settings.OS else None,
7575
verify_certs=False,
76-
timeout=600
76+
timeout=600,
77+
# opensearch-py leaves pool_maxsize unset, so the underlying
78+
# urllib3 HTTPConnectionPool falls back to maxsize=1.
79+
# OSConnection is a @singleton shared by every request thread,
80+
# so concurrent searches and the cluster.health() probe contend
81+
# on a single HTTP connection ("Connection pool is full,
82+
# discarding connection ... pool size: 1"), serializing requests
83+
# behind fresh TLS handshakes. Widen the pool to match the
84+
# multi-connection default elasticsearch-py already uses.
85+
pool_maxsize=32,
7786
)
7887
if self.os:
7988
self.info = self.os.info()

0 commit comments

Comments
 (0)