Skip to content

Backport fixes to 2.5 for 2.5.2 - #549

Merged
fcostaoliveira merged 5 commits into
2.5from
backport/2.5.2
Oct 6, 2026
Merged

fcostaoliveira merged 5 commits into
2.5from
backport/2.5.2

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Backports the patch-level fixes from `master` to the `2.5` maintenance branch, for the 2.5.2 release. Each commit is cherry-picked with `-x`.

The #541 cherry-pick conflicted in `Makefile.am`, because master also has the `rate_limiter_test` target from #519. #519 is not backported, so I kept only `socket_options_test`.

Not included:

These are left for 2.6.0.

Local validation (Linux, OpenSSL 3.0.13, libevent 2.1.12): the build succeeds and `make check` passes (`socket_options_test`, `prometheus_metrics_test`). I couldn't run the RLTest suite locally because the installed redis-py is too old for the harness, so CI is the check for that.

🤖 Generated with Claude Code


Note

Medium Risk
Changes connection setup (socket options) and URI credential/host lifetime, which affect every Redis connection path; CI-only and test changes dominate the diff but the runtime fixes warrant careful release validation.

Overview
Backports maintenance fixes for 2.5.2: connection bugs, URI handling, build/CI hardening, and broader test coverage on 2.* branches.

Runtime fixes: TCP setsockopt for keepalive and TCP_NODELAY now passes an explicit enabled = 1 instead of an uninitialized value. URI parsing stores host and credentials in std::string for the process lifetime, drops strdup/free cleanup, and emits precedence warnings only when the user actually set the conflicting CLI field (not for defaults like localhost or port 6379). Adds an OpenSSL 4.0 forward declaration for bitmask_is_contiguous() so TLS protocol validation compiles.

Tests: New socket_options_test (wired into make check and CI with -ftrivial-auto-var-init=zero), plus RLTest cases for URI auth ownership and parse errors. Zipfian mixed-workload tests wait for MONITOR readiness and assert per-command key patterns instead of a brittle pooled correlation.

CI/workflows: GitHub Actions run on 2.* branches. Debian Bullseye jobs pin a security archive snapshot post-EOL. macOS jobs build libevent against the matrix OpenSSL, run make check, and verify dylib links via new helper scripts; legacy OpenSSL 1.0.2 gets a dedicated libevent build.

Reviewed by Cursor Bugbot for commit 19b619a. Bugbot is set up for automated code reviews on this repo. Configure here.

fcostaoliveira and others added 4 commits October 6, 2026 16:19
* Repair Bullseye packages and legacy OpenSSL CI builds

* Fix mixed Zipfian test oracle for clustered workloads

* Verify legacy CI linkage and guard malformed monitor captures

* Use portable awk regular expressions in legacy linkage checks

* Make linkage inspection failures explicit inside the loop

* Wait for MONITOR readiness in both Zipfian benchmark helpers

(cherry picked from commit 2552312)
* Test socket options across connection setup and reconnects

* Link socket regression test against real client RTTI

* Initialize TCP keepalive and no-delay socket options

* Keep socket option checks portable and verify linger policy

* Run socket regression tests in all macOS builds

* Capture macOS socket test failure diagnostics

* Build macOS libevent against each selected OpenSSL

* Make uninitialized socket regressions deterministic in CI

* Preserve normal and Homebrew builds alongside socket diagnostics

* Require macOS checks and keep diagnostic flags scoped to the test

* test: give socket connections a real client manager

* test: match production OpenSSL compatibility guards

(cherry picked from commit 76b2b8f)
* Fix ownership of URI authentication credentials

* Preserve ownership of omitted URI hosts and verify auth precedence

* Warn about URI precedence only for supplied connection fields

* Fix URI precedence warnings for supplied fields

(cherry picked from commit abdbb35)
The build will fail with the following undeclared identifier error:

    memtier_benchmark.cpp:2133:18: error: use of undeclared identifier 'bitmask_is_contiguous'
     2133 |             if (!bitmask_is_contiguous(cfg->tls_protocols)) {
          |                  ^~~~~~~~~~~~~~~~~~~~~
    1 error generated.

We can fix this by declaring it before it is used.

(cherry picked from commit c035b33)
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🤖 Automated first-pass review — a human maintainer's review is still required before merge.

I checked this as a backport rather than reviewing it as new code. #540, #541 and #544 are already on master, so I compared each cherry-pick with master and looked closely at the parts that are not straight picks.

Resolved conflict in Makefile.am: this looks right. Master has check_PROGRAMS = prometheus_metrics_test rate_limiter_test socket_options_test. Dropping rate_limiter_test (from #519, not backported) and keeping the socket_options_test block word for word is the correct resolution.

#548 provenance. The PR body says "#548 is not merged to master yet", but master now has it as fc668d7 Fix build with OpenSSL 4.0 (#548). The -x trailer on the backported commit says cherry picked from commit c035b33…, which looks like the PR-branch commit from before the squash, not the commit that landed on master. The code matches what is on master (the forward declaration under OPENSSL_VERSION_NUMBER >= 0x40000000L). I'd still amend the trailer to point at fc668d7 and update the body, so git log on 2.5 can be traced back to a commit that exists on master.

ci: run CI on maintenance branches (2.*). This is the only commit that isn't a cherry-pick, and it exists only on 2.5. Master's workflows still use [master, main]. That's enough for PRs that target 2.5, since a pull_request run takes its workflow from the merge ref. But the trigger lists on master and 2.5 now differ, so every later backport of a workflow change will conflict on these lines. Consider landing the same '2.*' change on master as well.

On release-rpm.yml, I checked what pushes to 2.* will now do. Upload as release assets is gated on github.event_name == 'release'. publish-to-yum is gated on release && !prerelease. So pushes and PRs on 2.5 only build and smoke-test the RPMs and never publish, which matches the commit message.

User-visible change in a patch release (minor). #544 moves the precedence warnings into parse_uri() and decides them by whether a field is set, not whether it differs from the default. So --port=6379 --uri=… and --server=localhost --uri=… now print warnings they didn't print in 2.5.1. Explicit --select-db=0 still prints none: zero can't be told apart from "not set", which uri-db-zero-cli tests on purpose. The new behaviour is better, and these are warnings on stderr, not output format. Still, scripts that grep stderr could see a difference, so a line in the 2.5.2 release notes would help.

No other findings. The URI ownership change (credentials and host stored in std::strings that live for the whole of main(), with the old free() of borrowed CLI pointers removed) matches master. So does the setsockopt fix with const int enabled = 1.

Backport PRs into 2.x maintenance branches previously only got the
review bots, since every build/test workflow filtered on master/main.
Publish jobs remain gated on release events.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants