Skip to content

Commit cda2982

Browse files
committed
fix(gooddata-pandas): drain HTTP body to enable keep-alive reuse
risk: low
1 parent 4d81813 commit cda2982

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • packages/gooddata-sdk/src/gooddata_sdk/compute/model

packages/gooddata-sdk/src/gooddata_sdk/compute/model/execution.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# (C) 2022 GoodData Corporation
22
from __future__ import annotations
33

4+
import io
45
import logging
56
from typing import TYPE_CHECKING, Any, Union
67

@@ -408,9 +409,14 @@ def read_result_arrow(self) -> pyarrow.Table:
408409
_return_http_data_only=True,
409410
)
410411
try:
411-
return _ipc.open_stream(response).read_all()
412+
# Read the full HTTP response body before releasing the connection.
413+
# pyarrow's IPC stream reader stops at the Arrow EOS marker and may leave
414+
# the HTTP chunked-encoding terminator unread, which puts the connection in
415+
# Request-sent state and breaks HTTP keep-alive reuse.
416+
data = response.read()
412417
finally:
413418
response.release_conn()
419+
return _ipc.open_stream(io.BytesIO(data)).read_all()
414420

415421
def cancel(self) -> None:
416422
"""

0 commit comments

Comments
 (0)