When supporting streaming partial writes, the cache miss request may not
always find the corresponding body reader for the storage asset that its
upstream write is trying to fill.
This change adds a lookup_streaming_write storage API and allows the
miss handler to provide a streaming write tag for use with the API, so
that it may find the matching hit handler to serve downstream.
This changes the memory ordering for the lock status load to `SeqCst` from
`Relaxed` to eliminate a potential source of panics.
Panics had the frames:
```
pingora_proxy::proxy_cache::<T>::handle_lock_status (proxy_cache.rs:748)
pingora_proxy::proxy_cache::<T>::proxy_cache::{{closure}} (proxy_cache.rs:211)
pingora_proxy::HttpProxy<T>::process_request::{{closure}} (lib.rs:509)
pingora_proxy::HttpProxy<T>::process_new_http::{{closure}} (lib.rs:727)
```
which showed we were checking on the status of the lock, after waiting on it,
and still seeing its status as waiting. The status is returned by value, so this
is not a time-of-check to time-of-use problem, this is an inconsistency in how
the lock status is managed. The change in memory order is mostly for the sake of
this programmer's attempts to understand what is happening.
This also completes a couple of TODOs to limit the wait period as well as tag
the span with the lock status.
I was attempting to test upgrades on MacOS, and was a bit confused at the ECONNREFUSED error.
Having this log would help others avoiding troubleshooting this until it is supported.
Includes-commit: 6f80ce2f7a
Replicated-from: https://github.com/cloudflare/pingora/pull/327
This changes the Sentry field from the DSN string to the entire ClientOptions
struct. This will let us pass more information to the client SDK, including the
git-parsed version information.
---
test: add test for upstream health observe
---
renamed the function and added doc to make it intelligible
---
fix clippy error
---
Merge branch 'main' into main
---
test: fix test for backend do update
Co-authored-by: Tree Xie <tree.xie@outlook.com>
Includes-commit: 1421c26756
Includes-commit: 695d549014
Includes-commit: 6a09b52c5e
Includes-commit: 72d6ee09ae
Includes-commit: e6c2af0e77
Includes-commit: fb62869583
Replicated-from: https://github.com/cloudflare/pingora/pull/325
There could be a race condition where a Stale request waiting on cache
lock retries the cache lock and lookup, but enters cache_miss after
finding the asset is no longer present.
Before this change, the retry only happens on reused connections. The
shutting down could also happen on new connections as well. So this
change will retry in both cases.
Sometimes service dicovery can carry arbitrary information, such as
SNI and request path to instrument how to connect to backend servers.
Backend now support to carry this type of information.
This allows user defined L4 connect() to be used so that they can
customize the connect behavior such as changing socket options and
simulating errors in tests.
This PR updates the function signatures in the `ext.rs` file to use `*mut` instead of `*const` for the `ssl` and `cert` parameters in the `SSL_use_certificate` and `SSL_use_PrivateKey` functions. This indicates that the functions can modify the SSL and certificate objects as intended.
Ref:
- https://www.openssl.org/docs/man1.1.1/man3/SSL_use_certificate.htmlhttps://boringssl.googlesource.com/boringssl/+/refs/tags/~~~/ssl/ssl_cert.cc#292
Refactor the `cvt` function to use `c_long` instead of `c_int` for the return type for better compatibility with the types used in the OpenSSL library.
Also, add a test case for the `ssl_set_groups_list` function to ensure it handles valid and invalid input correctly.
---
chore(openssl):fix increase X509 reference count
Includes-commit: 7841271b4a
Includes-commit: e132431889
Replicated-from: https://github.com/cloudflare/pingora/pull/308