pingora/pingora-cache/Cargo.toml
Matthew Gumport e288bfe8f0 change lock status memory ordering, tag spans
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.
2024-09-06 13:43:53 -07:00

70 lines
1.8 KiB
TOML

[package]
name = "pingora-cache"
version = "0.3.0"
authors = ["Yuchen Wu <yuchen@cloudflare.com>"]
license = "Apache-2.0"
edition = "2021"
repository = "https://github.com/cloudflare/pingora"
categories = ["asynchronous", "network-programming"]
keywords = ["async", "http", "cache"]
description = """
HTTP caching APIs for Pingora proxy.
"""
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "pingora_cache"
path = "src/lib.rs"
[dependencies]
pingora-core = { version = "0.3.0", path = "../pingora-core", default-features = false }
pingora-error = { version = "0.3.0", path = "../pingora-error" }
pingora-header-serde = { version = "0.3.0", path = "../pingora-header-serde" }
pingora-http = { version = "0.3.0", path = "../pingora-http" }
pingora-lru = { version = "0.3.0", path = "../pingora-lru" }
pingora-timeout = { version = "0.3.0", path = "../pingora-timeout" }
http = { workspace = true }
indexmap = "1"
once_cell = { workspace = true }
regex = "1"
blake2 = "0.10"
serde = { version = "1.0", features = ["derive"] }
rmp-serde = "1"
bytes = { workspace = true }
httpdate = "1.0.2"
log = { workspace = true }
async-trait = { workspace = true }
parking_lot = "0.12"
rustracing = "0.5.1"
rustracing_jaeger = "0.7"
rmp = "0.8"
tokio = { workspace = true }
lru = { workspace = true }
ahash = { workspace = true }
hex = "0.4"
httparse = { workspace = true }
strum = { version = "0.26", features = ["derive"] }
[dev-dependencies]
tokio-test = "0.4"
tokio = { workspace = true, features = ["fs"] }
env_logger = "0.9"
dhat = "0"
futures = "0.3"
[[bench]]
name = "simple_lru_memory"
harness = false
[[bench]]
name = "lru_memory"
harness = false
[[bench]]
name = "lru_serde"
harness = false
[features]
default = ["openssl"]
openssl = ["pingora-core/openssl"]
boringssl = ["pingora-core/boringssl"]