Skip to content

Close the link on every dropped packet in the config epoch failover test - #5443

Merged
sarthakaggarwal97 merged 1 commit into
unstablefrom
agent/ci-fix/upstream/490a882c83f4c213
Dec 1, 2026
Merged

sarthakaggarwal97 merged 1 commit into
unstablefrom
agent/ci-fix/upstream/490a882c83f4c213

Conversation

@valkeyrie-ops

@valkeyrie-ops valkeyrie-ops Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Replica can update the config epoch when trigger the failover - automatic - drop_nack 0 failed in test-alpine-jemalloc on 9.2 (run). No change on unstable fixes it. The fix made there applies here as it is: it is made here first, and backported to 9.2 once it merges.

Root cause: The test turned on the drop-all filter on R3 and only then turned on close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033 between those two commands, so that link stayed open with a ping that R3 never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to every node right after the bump. R3 logged no dropped packet from then until the filter was removed at 37.068, so that PONG reached R3 only after the filter was gone. At 40.229 R3 started its election already knowing config epoch 5, R1 and R2 granted the vote without a NACK, and 'cannot reach quorum' was never logged. The most consistent reading is that R0's kernel held the PONG behind the unacknowledged ping until R3's delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY when a non-blocking connect returns EINPROGRESS. That last step is inferred, not proven by the log. The failure is flaky.

The fix: The server did not break a promise here. The test left a sub-millisecond gap in which a packet could be dropped without its link being closed, and that open link is what let a later packet from R0 arrive after the filter was lifted. With close-link-on-drop set first, the dropped ping closes the link, so anything R0 writes behind it goes to a closed socket and never reaches R3. Setting the close flag first has no effect of its own, because cluster_legacy.c only closes a link when the packet also matches the filter. The change is test only, two lines swapped plus a comment, and it applies to all four variants since they share the proc. The test still checks exactly what it checked before.

What the bot checked

  • The fix applies to unstable at 1a5d47e92d97, and was run there too.

  • With the fix, this command passed 40 loops:

    make -j"$(getconf _NPROCESSORS_ONLN)" SERVER_CFLAGS='-Werror' BUILD_ZSTD=yes USE_LIBBACKTRACE=yes && ./runtest --accurate --verbose --dump-logs --single unit/cluster/failover2 --only 'Replica can update the config epoch when trigger the failover - automatic - drop_nack 0' --fastfail --loops 40 --timeout 600 --clients 1
The agent's own notes

Nothing was built or run here. No upstream commit fixes this: the default branch has the same test with the two DEBUG commands in the same order and needs the same swap. I did not follow 150da30 on release branch 9.0, which moves the assertion after pause_process, because stopping R0 does not stop its kernel from sending data it already holds; if 9.0 enables the filter before the close flag as this branch did, it likely needs this swap too. The 8.0 commit 5a4841c handles CLUSTER BUMPEPOCH returning STILL, and in this log the bump succeeded. The log does not show which node sent the dropped ping or which packet carried the epoch to R3, since a processed packet is not logged; the swap removes the open link after a drop whichever it was. I restored the assertion to its place before pause_process from the 9.0 diff context and could not run git to confirm the surrounding blank line matches the original exactly. One narrow window remains in theory and is not what this log shows: a packet R0 sends between the assertion and its SIGSTOP could be read by R3 in the same event loop pass as the command that lifts the filter. The failure needs a ping to land between two consecutive commands, so passing loops are weak evidence either way. Whether non-blocking outbound connects should set TCP_NODELAY is a separate product question for a maintainer.

What the bot checked on 9.2
  • Existing fixes found: 9c4c8739da2e Apply the library load timeout to FUNCTION RESTORE (Apply the library load timeout to FUNCTION RESTORE #5181) (already ported as b57b9a3)

  • Code checks your change: the build must pass and the failing test must run and pass, once and then looped (up to 40 loops, fewer when one loop is slow):

    make -j"$(getconf _NPROCESSORS_ONLN)" SERVER_CFLAGS='-Werror' BUILD_ZSTD=yes USE_LIBBACKTRACE=yes && ./runtest --accurate --verbose --dump-logs --single unit/cluster/failover2 --only 'Replica can update the config epoch when trigger the failover - automatic - drop_nack 0' --fastfail --loops 40 --timeout 600 --clients 1

    A planned file uses run_solo, so its loops run one at a time.

  • No change on the default branch was found to fix this failure, so this fix was written for this branch: the default branch does not have it.

  • With the fix, this command passed 40 loops:

    make -j"$(getconf _NPROCESSORS_ONLN)" SERVER_CFLAGS='-Werror' BUILD_ZSTD=yes USE_LIBBACKTRACE=yes && ./runtest --accurate --verbose --dump-logs --single unit/cluster/failover2 --only 'Replica can update the config epoch when trigger the failover - automatic - drop_nack 0' --fastfail --loops 40 --timeout 600 --clients 1
  • Review: The log supports the diagnosis: R3 set the drop-all filter at 37.033, dropped one ping, and only then set close-link-on-drop, so that link stayed open. R0 bumped to epoch 5 at 37.034 and broadcasts a PONG on the bump (CLUSTER_TODO_BROADCAST_ALL), yet R3 logged no further drop before the filter was lifted at 37.068 and then started its election already at config epoch 5, so R1 and R2 granted the vote and 'cannot reach quorum' never appeared. The code matches the author's claims: anet.c skips TCP_NODELAY when a non-blocking connect returns EINPROGRESS, and cluster_legacy.c closes a link only when the packet also matches the filter, so setting the close flag first has no effect of its own. The Nagle and delayed-ACK step is inferred, and the author says so, but the swap is correct whichever packet carried the epoch, because a dropped packet now always closes its link and nothing queued behind it can reach R3. The change is test only, two lines swapped, weakens no assertion, adds no wait or retry, and the comment explains the ordering without narrating history. The remaining narrow window between the assertion and R0's SIGSTOP predates this patch and is disclosed.

  • Accepted on round 2 of 3.


Prepared by the CI-fix bot, which never merges. This PR's CI and a maintainer's review decide. Its commit has no DCO sign-off: whoever takes the change over signs it off.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7a5eb71c-65f4-43a3-a14e-08297c489d1e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.00%. Comparing base (12b3635) to head (63ee1ee).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #5443      +/-   ##
============================================
+ Coverage     81.71%   82.00%   +0.29%     
============================================
  Files           203      203              
  Lines        105998   105998              
============================================
+ Hits          86614    86922     +308     
+ Misses        19384    19076     -308     

see 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

sarthakaggarwal97 added a commit to valkey-io/valkey-ci-agent that referenced this pull request Nov 17, 2026
…ranch's (#168)

The first PRs into unstable (valkey-io/valkey#5437, valkey-io/valkey#5440,
valkey-io/valkey#5443) showed the release branch agent's notes as if they
were about unstable ("Nothing was built or run here", "I could not read
its copy of the test"), right under the line saying the fix passed there.
They now have their own section, named for the release branch.

Every published fix also carried the plan the agent is given, "Code
checks your change with `<command>`: ...", next to the line saying what
that command did. Only what ran is published now, with the plan's notes
(a stand-in for the job, a run_solo file). The agent and the reviewer
still get the plan, and a fix nothing can run still says so.

docs/backport.md said a fix for unstable passes at least 10 loops. Under
valgrind it is the 4 that are planned.

Signed-off-by: Sarthak Aggarwal <[email protected]>
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…est (valkey-io#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…est (valkey-io#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…est (valkey-io#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Nov 17, 2026
…est (valkey-io#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…est (#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…est (#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443

@xdk-amz xdk-amz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Setting close-link-on-drop before the drop filter closes the gap completely, not just narrows it: clusterProcessPacket() only closes a link when the packet also matches the filter, and the filter defaults to -1, so the close flag does nothing until the filter is armed, and from then on every drop closes its link. I checked this in R3's log on a local run: each "Dropping packet of type ..." line is immediately followed by "Closing link for matching packet type ...". The drop_nack 0 variant passed 5/5 with --loops 5. Reverting doesn't reliably fail, since the race needs a packet inside a sub-millisecond window.

Two things outside the diff:

  • The commit has no Signed-off-by, so DCO is failing. Since the author is a bot, a maintainer will need to re-commit it with -s before merge.
  • cluster-reliable-meet.tcl:38 and cluster-multiple-meets.tcl:35 still set the filter before the close flag. They use narrow filters (MEET / PONG), so they're lower risk, but swapping them in a follow-up would keep anyone from copying the old order.

Comment thread tests/unit/cluster/failover2.tcl Outdated
R 3 DEBUG DROP-CLUSTER-PACKET-FILTER $CLUSTER_PACKET_TYPE_ALL
# Enable closing the link before the filter, so that every dropped
# packet closes its link. A link left open after a drop never answers
# the dropped packet, and the sender's TCP stack can hold the packets

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the comment states that the sender's TCP stack holds the packets behind the dropped one, but per the PR description that Nagle/delayed-ACK part is inferred, not shown in the log. The comment would hold up longer if it stuck to what the ordering guarantees, e.g. "Enable closing the link before the filter, so every dropped packet closes its link and nothing queued behind it can be delivered after the filter is lifted." and left the TCP theory to the PR description.

@Baraa-Hasheesh

Copy link
Copy Markdown
Contributor

I think this also handles #5457

sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…est (#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…est (#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…est (#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443
sarthakaggarwal97 pushed a commit that referenced this pull request Nov 18, 2026
…est (#5443)

The test turned on the drop-all filter on R3 and only then turned on
close-link-on-drop. In the log R3 dropped one ping at 09:27:37.033
between those two commands, so that link stayed open with a ping that R3
never answered. R0 set configEpoch 5 at 37.034 and queues a PONG to
every node right after the bump. R3 logged no dropped packet from then
until the filter was removed at 37.068, so that PONG reached R3 only
after the filter was gone. At 40.229 R3 started its election already
knowing config epoch 5, R1 and R2 granted the vote without a NACK, and
'cannot reach quorum' was never logged. The most consistent reading is
that R0's kernel held the PONG behind the unacknowledged ping until R3's
delayed ACK about 40 ms later, because anet.c does not set TCP_NODELAY
when a non-blocking connect returns EINPROGRESS. That last step is
inferred, not proven by the log.

The server did not break a promise here. The test left a sub-millisecond
gap in which a packet could be dropped without its link being closed,
and that open link is what let a later packet from R0 arrive after the
filter was lifted. With close-link-on-drop set first, the dropped ping
closes the link, so anything R0 writes behind it goes to a closed socket
and never reaches R3. Setting the close flag first has no effect of its
own, because cluster_legacy.c only closes a link when the packet also
matches the filter. The change is test only, two lines swapped plus a
comment, and it applies to all four variants since they share the proc.
The test still checks exactly what it checked before.

Backport-Source-PR: 5443

@madolson madolson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Needs a signed-off re-commit for DCO.

sarthakaggarwal97 added a commit to sarthakaggarwal97/valkey-ci-agent that referenced this pull request Dec 1, 2026
The agent's commits were made as valkeyrie-bot[bot], a name with no
GitHub account behind it, and most had no DCO sign-off. Its own fixes
and repair commits had none, and a backport kept only what its upstream
commit carried: sometimes nothing, sometimes a sign-off under another
email than its author's. The DCO check therefore fails on the sweep pull
requests (valkey-io/valkey#5619, valkey-io/valkey#5499), on the CI-sweep
pull requests (valkey-io/valkey#5441) and on the fixes opened into
unstable (valkey-io/valkey#5437, valkey-io/valkey#5440,
valkey-io/valkey#5443), and a maintainer has to override it.

Every commit the agent makes is now committed and signed off by
valkeyrie-ops[bot], the App that opens its pull requests. The identity
and the sign-off line are in scripts/common/identity.py, and
proc.set_commit_identity gives them to a clone.

- A commit the agent writes (a CI fix, a sweep's repair commit, a
  revert, a release cut) has the App as its author.
- A commit it cherry-picks (a backport, an upstream fix ported to a
  backport branch) keeps its author and its own sign-off, and gets the
  App's as its committer. The DCO check takes a sign-off from a
  commit's author or its committer.
- An open sweep branch from before this is signed off once, the next
  time it is rebased. Other open pull requests keep their commits.

The pull requests the CI-fix bot opens now say that their commit
carries the bot's sign-off and that a maintainer adds their own before
merging. Nothing checks for the maintainer's.

The registry edit that onboards a release branch is unchanged: it is
github-actions[bot]'s commit and is already signed off.

Signed-off-by: Sarthak Aggarwal <[email protected]>
Enable close-link-on-drop before arming the drop filter so every
dropped packet closes its link. Otherwise queued traffic on a link
left open by a drop can be processed after the filter is lifted.

Explain the ordering guarantee without assuming a particular cause
of the delayed packet delivery.

Signed off on behalf of valkeyrie-ops[bot].

Signed-off-by: Sarthak Aggarwal <[email protected]>
@sarthakaggarwal97
sarthakaggarwal97 force-pushed the agent/ci-fix/upstream/490a882c83f4c213 branch from df486fe to 63ee1ee Compare December 1, 2026 17:37
sarthakaggarwal97 added a commit to valkey-io/valkey-ci-agent that referenced this pull request Dec 1, 2026
* Sign off every commit the agent makes as valkeyrie-ops

The agent's commits were made as valkeyrie-bot[bot], a name with no
GitHub account behind it, and most had no DCO sign-off. Its own fixes
and repair commits had none, and a backport kept only what its upstream
commit carried: sometimes nothing, sometimes a sign-off under another
email than its author's. The DCO check therefore fails on the sweep pull
requests (valkey-io/valkey#5619, valkey-io/valkey#5499), on the CI-sweep
pull requests (valkey-io/valkey#5441) and on the fixes opened into
unstable (valkey-io/valkey#5437, valkey-io/valkey#5440,
valkey-io/valkey#5443), and a maintainer has to override it.

Every commit the agent makes is now committed and signed off by
valkeyrie-ops[bot], the App that opens its pull requests. The identity
and the sign-off line are in scripts/common/identity.py, and
proc.set_commit_identity gives them to a clone.

- A commit the agent writes (a CI fix, a sweep's repair commit, a
  revert, a release cut) has the App as its author.
- A commit it cherry-picks (a backport, an upstream fix ported to a
  backport branch) keeps its author and its own sign-off, and gets the
  App's as its committer. The DCO check takes a sign-off from a
  commit's author or its committer.
- An open sweep branch from before this is signed off once, the next
  time it is rebased. Other open pull requests keep their commits.

The pull requests the CI-fix bot opens now say that their commit
carries the bot's sign-off and that a maintainer adds their own before
merging. Nothing checks for the maintainer's.

The registry edit that onboards a release branch is unchanged: it is
github-actions[bot]'s commit and is already signed off.

Signed-off-by: Sarthak Aggarwal <[email protected]>

* Pass the App's identity with each commit command

A sweep commits in the clone its validation builds and tests in, and
git took the committer, and the name `commit -s` signs with, from that
clone's config, set once after cloning. A test that rewrote the config
changed whose commit and sign-off the next one was.

Every git command that commits now gets the identity in its environment
(proc.commit_env), which git reads before any config, and a clone is no
longer given one. A cherry-pick, a rebase and an amend still keep the
commit's author.

A CI fix written before the sign-offs keeps its unsigned commit when its
CI-sweep branch is rebuilt. The docs now say so.

Signed-off-by: Sarthak Aggarwal <[email protected]>

---------

Signed-off-by: Sarthak Aggarwal <[email protected]>
@sarthakaggarwal97
sarthakaggarwal97 merged commit 1c6c881 into unstable Dec 1, 2026
89 checks passed
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.

4 participants