Tags: Netflix/zuul
Tags
Switch ConnCounter to rely on PolledMeters (#2206) `ConnCounter` tracks connection counts by manually updating a gauge. This approach can lead to negative connection counts when gauges expire. The gauges used in this class expire 15 mins after the last update. Stable http/2 connections to origins are especially susceptible to getting lost. The new approach relies on a PolledMeter monitoring an AtomicLong. Each event loop independently tracks its own counts (internally gauges maintain a list of all monitored numbers with the same id, and sum them up). I did this to simplify the cleanup logic
Retry on CLOSE_NOTIFY_CONNECTION (#2198) Zuul was not retrying requests that failed with `CLOSE_NOTIFY_CONNECTION` because most close_notifies came from malformed requests, but Zuul now validates headers upstream, so the remaining cases are safe to retry. This change adds `CLOSE_NOTIFY_CONNECTION` to `isRetryable`, gated on idempotent methods (GET/HEAD/OPTIONS) so a POST the origin may have already processed is never replayed. The retry logic is refactored into two intent-named branches (connection failures retry for any method; ambiguous failures retry idempotent methods only), and the duplicated idempotency check is pulled into a shared isIdempotentRequest helper. Adds unit tests covering GET vs POST on close_notify, plus a regression guard that `RESET_CONNECTION`/`CONNECT_ERROR` stay retryable for all methods.
Add new connection pool options for using default buffer sizing (#2176) This PR adds a new connection pool configuration that skips configuring TCP buffer sizes on origin connections. When the new flag is true, the connection pool will no longer explicitly set socket options for SNDBUF and RCVBUF, and instead the default OS setting is used. A benefit of relying on the OS is that we can allow it to autotune the buffer sizes for us
Nullmark SessionContext (#2174) The primary change in this PR is null marking SessionContext. As part of nullmarking, I converted some of the fields that were stored as elements in the map into proper member variables. For example, EventProperties used to be stored in the map which would have required marking `getEventProperties()` as @nullable, but by making it a member variable I'm able to ensure it is never null. For other elements that are still saved in the map (e.g. uuid) I switched to typed keys. I also cleaned up some messy generic usage around the typed map, and added logic to pre-size it
Add `Headers.collapseMultiValuedHeaders()` (#2172) `Headers` has `setAll` for writing multiple values per name, but nothing for the reverse - reducing a header that appears more than once down to a single value. Some clients can mistakenly send duplicate singleton headers (e.g. a repeated `content-type`), and strict HTTP/2 origins reject the duplicate. This adds `collapseMultiValuedHeaders()`, which reduces every repeated header to a single entry holding its last value - the same last-write-wins rule as `set(...)`.
Avoid allocating an iterator per filter in `FilterConstraints.isConst… …rained` (#2169) `isConstrained` runs for every filter on the request and response path and walks its constraint list with an enhanced-for, allocating an iterator each call. This PR short-circuits the empty case and iterates by index instead to avoid some allocation overheads. JMH results: `14.1 ns/op, 192 B/op` -> `4.0 ns/op, ~0 B/op` for a mixed batch of filters.
Add single-pass `setAll` to `Headers` that preserves multi-valued hea… …ders (#2157) There's currently no way to bulk-replace a batch of headers from another source in one shot. Callers that want to overlay headers from say, a netty `HttpHeaders` collection, have to loop-set-per-entry, and because `set` is replace-all, it collapses any name that appears more than once in the input down to its last value. For example, feeding two `Set-Cookie` entries through a `set` loop leaves you with one. This PR adds `setAll(Iterable<Map.Entry<String, String>>)` - a single pass that replaces every name present in the input (adding ones that aren't already there) while preserving its multiple values, and leaves headers not in the input untouched.
PreviousNext