Skip to content

Commit 025714e

Browse files
BYKclaude
andcommitted
fix: Always add keep-alive socket options in httpcore transports
The original Http2Transport always added KEEP_ALIVE_SOCKET_OPTIONS unconditionally. The refactored _get_httpcore_pool_options incorrectly wrapped this in an 'if keep_alive' guard. Remove the guard to match the original behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 36ad606 commit 025714e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sentry_sdk/transport.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,10 @@ def _get_httpcore_pool_options(
551551
else []
552552
)
553553

554-
if self.options["keep_alive"]:
555-
used_options = {(o[0], o[1]) for o in socket_options}
556-
for default_option in KEEP_ALIVE_SOCKET_OPTIONS:
557-
if (default_option[0], default_option[1]) not in used_options:
558-
socket_options.append(default_option)
554+
used_options = {(o[0], o[1]) for o in socket_options}
555+
for default_option in KEEP_ALIVE_SOCKET_OPTIONS:
556+
if (default_option[0], default_option[1]) not in used_options:
557+
socket_options.append(default_option)
559558

560559
options["socket_options"] = socket_options
561560

0 commit comments

Comments
 (0)