Justas Cesnauskas
b1aa0a9be0
fix(auxiliary): the watchdog Timer shuts the attempt stream's socket down instead of closing the stream
...
_CodexStreamGuard._close_client_on_timeout keeps the FD-ownership contract for the client's pool sockets
(shutdown() from the Timer, close() only on the owning thread), but then called close_attempt_stream(),
and an SDK Stream.close() on an unfinished response ends in sock.close() (httpx Response.close ->
httpcore HTTP11Connection.close -> SyncStream.close). That releases the descriptor while the owner is
still inside SSL_read: the kernel hands the number to the next open() and OpenSSL writes a TLS alert
record into that file. Two SQLite files in a gateway process lost bytes 5..28 of their header this way
(b"SQLit" + 17 03 03 00 13 ...), 15 ms after "Codex auxiliary client aborted (timeout,
tcp_force_closed=1, deferred_close=stranger_thread)".
close_attempt_stream() now does a real close() only on the owning thread. From any other thread it
shuts down the socket under the stream (stream.response.extensions["network_stream"]), which wakes the
reader and keeps the FD; the owner closes the stream in its finally (release_stream). A stream with no
reachable socket (a test double, a non-httpx transport) is closed as before.
Fixes #130115 . Follow-up to #70773 .
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com >
(cherry picked from commit 33cfb5ea6550f4a56ea0faa072ddf7f91412af49)
2026-10-03 16:35:32 +05:30
..
2026-09-29 03:28:46 +05:30
2026-09-28 10:21:41 -07:00
2026-10-02 01:18:03 +05:30
2026-09-28 10:21:41 -07:00
2026-09-29 22:57:48 -04:00
2026-10-03 16:29:34 +05:30
2026-09-25 21:27:06 +05:30
2026-09-28 12:53:29 -05:00
2026-10-02 04:09:57 -07:00
2026-10-03 16:31:39 +05:30
2026-09-28 14:16:18 -07:00
2026-09-28 10:21:41 -07:00
2026-10-02 00:18:00 +05:30
2026-10-02 00:18:00 +05:30
2026-10-02 00:18:00 +05:30
2026-09-29 23:54:34 +05:30
2026-10-03 16:35:32 +05:30
2026-10-02 16:44:56 -07:00
2026-10-02 16:44:56 -07:00
2026-09-28 10:21:41 -07:00
2026-09-30 22:59:48 -05:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-10-03 16:31:39 +05:30
2026-09-25 13:49:31 -05:00
2026-10-01 12:08:13 -07:00
2026-10-03 16:31:39 +05:30
2026-10-02 01:24:41 +05:30
2026-09-28 12:43:03 -07:00
2026-10-02 00:50:20 +05:30
2026-09-28 14:16:18 -07:00
2026-10-03 16:26:31 +05:30
2026-09-26 23:49:25 +05:30
2026-09-28 11:29:49 -05:00
2026-09-27 20:45:56 +05:30
2026-10-03 16:30:48 +05:30
2026-10-02 00:50:20 +05:30
2026-09-26 11:22:06 -07:00
2026-10-02 00:03:01 +05:30
2026-09-28 10:21:41 -07:00
2026-09-26 17:59:52 -05:00
2026-09-27 00:04:22 +05:30
2026-09-28 12:43:03 -07:00
2026-10-02 22:21:27 -05:00
2026-09-29 18:33:44 +05:30
2026-10-02 22:59:00 -05:00
2026-09-29 19:31:49 -05:00
2026-09-28 10:21:41 -07:00
2026-10-03 16:29:34 +05:30
2026-09-28 10:21:41 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-10-02 01:18:03 +05:30
2026-09-28 10:21:41 -07:00
2026-09-29 22:07:30 +05:30
2026-09-27 02:02:41 +05:30
2026-10-01 09:26:00 -04:00
2026-09-30 22:30:35 -04:00
2026-09-28 10:21:41 -07:00
2026-09-30 23:10:24 -05:00
2026-09-28 12:43:03 -07:00
2026-09-29 19:42:46 -05:00
2026-10-02 12:29:16 -04:00
2026-09-29 04:15:21 +05:30
2026-10-02 20:28:55 -05:00
2026-10-02 20:29:34 -05:00
2026-10-01 16:18:23 +05:30
2026-09-28 10:21:41 -07:00
2026-09-27 01:55:21 +05:30
2026-09-28 10:21:41 -07:00
2026-10-01 11:45:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-27 00:38:34 +05:30
2026-10-02 01:18:03 +05:30
2026-09-26 17:59:52 -05:00
2026-10-03 16:29:34 +05:30
2026-09-26 22:21:47 +05:30
2026-09-27 02:48:48 -05:00
2026-09-25 21:28:32 +05:30
2026-10-02 00:52:27 +05:30
2026-10-02 16:29:18 -05:00
2026-09-29 12:16:43 -04:00
2026-09-28 10:21:41 -07:00
2026-10-02 00:53:19 +05:30
2026-09-28 10:21:41 -07:00
2026-09-28 11:29:49 -05:00
2026-09-27 01:10:56 +05:30
2026-09-29 14:53:00 -05:00
2026-09-29 22:57:48 -04:00
2026-10-02 13:50:23 -04:00
2026-09-29 04:15:21 +05:30
2026-10-02 20:18:26 -05:00
2026-09-28 10:21:41 -07:00
2026-09-29 18:05:05 -05:00
2026-09-26 23:49:25 +05:30
2026-09-28 10:21:41 -07:00
2026-10-02 04:09:57 -07:00
2026-09-26 06:10:53 +05:30
2026-09-29 14:53:00 -05:00
2026-09-27 02:22:23 +05:30
2026-10-01 11:45:41 -07:00
2026-10-01 00:42:30 -05:00
2026-09-28 10:21:41 -07:00
2026-09-26 20:40:40 -05:00
2026-10-01 23:50:31 -07:00
2026-10-02 00:50:20 +05:30
2026-10-01 13:23:12 -07:00
2026-09-28 12:43:03 -07:00
2026-10-02 01:04:12 +05:30
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-10-01 03:27:39 -05:00
2026-09-28 12:43:03 -07:00
2026-10-02 04:09:57 -07:00
2026-09-28 14:16:18 -07:00
2026-09-29 02:47:39 +05:30
2026-09-29 15:57:52 -05:00
2026-09-26 06:10:53 +05:30
2026-09-28 12:43:03 -07:00
2026-10-02 00:50:20 +05:30
2026-10-02 13:50:23 -04:00
2026-09-28 12:43:03 -07:00
2026-10-01 12:08:13 -07:00
2026-10-02 00:18:00 +05:30
2026-09-28 12:43:03 -07:00
2026-09-28 12:43:03 -07:00
2026-09-28 10:21:41 -07:00
2026-10-02 12:29:16 -04:00
2026-10-02 12:29:16 -04:00
2026-10-02 00:53:19 +05:30
2026-09-29 23:54:34 +05:30
2026-09-26 17:15:30 -05:00
2026-10-01 16:40:58 +05:30
2026-09-26 23:49:25 +05:30
2026-10-02 01:18:03 +05:30
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00