Commit 5f31a6b
committed
tls: add read deadline to containers/image registry connections
A stalled TLS connection to a container registry (e.g. quay.io) can
cause image pulls to hang indefinitely. The HTTP response body read
blocks forever in tls.Conn.Read with no timeout, starving the entire
pull pipeline and leaving pods stuck in ContainerCreating for hours.
Wrap the HTTP transport dialer with a deadlineConn that enforces a
5-minute read deadline via SetReadDeadline on every Read call. When
triggered, bodyReader treats the timeout the same as ECONNRESET and
attempts a Range-based reconnect to resume the download. Also add a
2-minute ResponseHeaderTimeout to the transport.
Ref: https://redhat.atlassian.net/browse/OCPBUGS-795441 parent d39d7e5 commit 5f31a6b
2 files changed
Lines changed: 49 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
| |||
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
150 | | - | |
| 161 | + | |
151 | 162 | | |
152 | 163 | | |
153 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
963 | 972 | | |
964 | 973 | | |
965 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
966 | 991 | | |
967 | 992 | | |
968 | 993 | | |
| |||
973 | 998 | | |
974 | 999 | | |
975 | 1000 | | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
976 | 1012 | | |
977 | 1013 | | |
978 | 1014 | | |
| |||
982 | 1018 | | |
983 | 1019 | | |
984 | 1020 | | |
| 1021 | + | |
985 | 1022 | | |
986 | 1023 | | |
987 | 1024 | | |
| |||
0 commit comments