It is possible that when two threads try to release streams of the same
h2 connection, one thread would register the connection in the in_use_pool
while the other register it in the idle_pool.
The solution is to put a lock so that the connection can only appear in
one pool at a time.
Provide default and non_exhaustive for TcpSocketOptions to future proof
its changes.
Also fix an issue that TcpScoketOptions can't be used for IPv4 sockets
at all.
SO_RCVBUF needs to be set before connect otherwise tcp settings will
not be finalized correctly. And since autotuning is not engaged in this
case, the throughput will suffer.
Define `group_id` in the pingora-core's server daemon on FreeBSD.
---
Merge branch 'cloudflare:main' into yonas-~~~
Co-authored-by: Yonas Yanfa <yonas.y@gmail.com>
Includes-commit: 30ee1e8bd4
Includes-commit: df9f2da7bd
Replicated-from: https://github.com/cloudflare/pingora/pull/28
The TinyLFU test was failing for changes unrelated to anything in the tinyufo
crate. This changes the test to stop that! What was occurring was expected
behavior, so the test is what's changing instead of any internal logic.
What was happening were hash collisions in the bloom filter used by the
estimator. Instead of asserting that we'd always start counting from 0, we now
allow for this in the test by `get()`ing first, then comparing relative
values. For the final comparisons, we check that values are greater-than or
equal-to their lower bound as determined by the number of `incr()`s we called on
their keys.
My editor was defaulting to using the 2015 edition of the parser since that's
the default for an unset edition in fmt file. This fixes that by specifying that
we want to use the same edition for formatting that we do everywhere else.
https://github.com/cloudflare/pingora/issues/181
Ran:
```
rg --pcre2 '(?<!(trace\!\()|(println\!\()|(warn\!\()|(info\!\()|(debug\!\()|(format\!\()|(error\!\()|(write\!\()|(panic\!\())\".*\{.+\"'
```
and audited the 200+ results by hand. Only messed up in a few places!
Hat-tip to Kevin for helping me understand the compile error messages I was
seeing trying to fix this naively.
This filter allows customizing the `ETag`/`Last-Modified` check to see
if the proxy cache can return 304 Not Modified instead of the full
response.
Also flesh out the `ETag`/`Last-Modified` handling in the base
`not_modified_filter` with `If-None-Match` and `If-Modified-Since`.
And other things.
Co-authored-by: DimanNe <causal.consistency@proton.me>
Co-authored-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: lilo <luolee.me@gmail.com>
Co-authored-by: Yang He <abruzzi.hraig@gmail.com>