Skip to content

Commit 93cc104

Browse files
network: explicitly close connection for log event (#469)
Context: One of the company -- affirm reported that they are seeing higher econnreset error after we started using session and cause higher log event drop rate. I did some research this might be because when use request.session() connection headers is set to be keep-alive I am testing more https://statsigconnect.slack.com/archives/C0667QXTWCU/p1761587654203119?thread_ts=1761587241.636689&cid=C0667QXTWCU Tested and verified request.session() sends extra header on connection:keep-alive And my current approach works
1 parent f1ef119 commit 93cc104

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

statsig/http_worker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def log_events(
154154
disable_compression = _SDK_Configs.on("stop_log_event_compression")
155155
additional_headers = {
156156
"STATSIG-RETRY": str(retry),
157+
"Connection": "close"
157158
}
158159
if headers is not None:
159160
additional_headers.update(headers)

0 commit comments

Comments
 (0)