| commit | a444ee81c653b5d8561404e325d8c2ce9eceb897 | [log] [tgz] |
|---|---|---|
| author | Shounak Mitra <shounak@google.com> | Tue Jan 14 11:43:36 2025 -0800 |
| committer | Copybara-Service <copybara-worker@google.com> | Tue Jan 14 11:44:12 2025 -0800 |
| tree | e87474a56af5f726c601a12432f11f44fdf15056 | |
| parent | 44779d64efbc3e623ba83252e5a1357cd0a82791 [diff] |
#vbmc - Use a pool of http clients to service concurrent requests `CurlHttpClient` is [not thread safe](https://source.corp.google.com/piper///depot/google3/third_party/ecclesia/lib/http/curl_client.h;rcl=677857727;cl=713100915;l=188), so we should not send concurrent requests on the same client. In order to allow concurrent requests in vBMC, this is implemented by creating a pool of clients. Each request will first allocate a client from the pool, then complete the request, and finally return the client to the pool. Since most requests are _not_ concurrent, the pool is implemented as a stack so that requests preferentially use the same client repeatedly. This lets us make better use of curl's connection pool. PiperOrigin-RevId: 715464667 Change-Id: I34c0a0f0e888a26548bda7b748fe6bf54d023f82