Commit 4d381d7
authored
transport/http: don't reuse a base transport between clients (#532)
Previously sync.Once was used to cache a fallback base transport.
This caused a race condition when setting MaxIdleConnsPerHost
and TLSClientConfig in defaultBaseTransport (above). Because of these
settings, it isn't valid to share the base transport across clients.
I conferred with @neild and determined that it is impossible to implement a
transport.Clone for < Go 1.13, so instead we should initialize
a new transport with default values each time in this case.
Fixes googleapis/google-cloud-go#24051 parent 9a7bb2b commit 4d381d7
1 file changed
Lines changed: 13 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
191 | 190 | | |
192 | 191 | | |
193 | 192 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | 193 | | |
200 | 194 | | |
201 | 195 | | |
202 | 196 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
219 | 210 | | |
220 | 211 | | |
221 | 212 | | |
| |||
0 commit comments