Skip to content

rgw/beast: use strand executor for timeout timer to prevent concurrent socket access - #67424

Merged
cbodley merged 1 commit into
ceph:mainfrom
BBoozmen:wip-oozmen-75031
Apr 20, 2026
Merged

cbodley merged 1 commit into
ceph:mainfrom
BBoozmen:wip-oozmen-75031

Conversation

@BBoozmen

Copy link
Copy Markdown
Contributor

Fixes https://tracker.ceph.com/issues/75031.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

…t socket access

The timeout_timer in AsioFrontend::on_accept() was constructed with
context.get_executor(), which dispatches the timeout handler to the
raw io_context. Since each connection's coroutine runs on a strand
(via make_strand(context)), this allowed the timeout handler to
execute concurrently with the coroutine on a different thread.

When the timeout fires, timeout_handler calls socket.cancel() and
socket.shutdown() racing with the coroutine's async_read_header(),
async_write(), or async_read_some() on the same socket and buffer.
This can corrupt the flat_static_buffer's internal pointers, leading
to SIGSEGV in the Beast HTTP parser.

Fix by constructing the timeout_timer with yield.get_executor(),
which returns the coroutine's strand executor. This ensures the
timeout handler is serialized with the coroutine, preventing
concurrent access to the socket and buffer.

Fixes: https://tracker.ceph.com/issues/75031
Signed-off-by: Oguzhan Ozmen <[email protected]>
@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor

Since the boost version is newer than when the code was originally written, I wonder if boost::asio::cancel_after with cancellation_type::terminal can be used for the boost::beast::http::async_* calls? It seems like with cancellation_type::terminal, the cancellation will close the underlying socket.

Comment thread src/rgw/rgw_asio_frontend.cc Resolved
@cbodley

cbodley commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Since the boost version is newer than when the code was originally written, I wonder if boost::asio::cancel_after with cancellation_type::terminal can be used for the boost::beast::http::async_* calls? It seems like with cancellation_type::terminal, the cancellation will close the underlying socket.

thanks @jzhu116-bloomberg. i don't think that cancel_after() would close the socket. as i understand it, that relates to per-op cancellation which only effects that one async op. in contrast, the current timeout_handler uses socket.cancel() to cancel all outstanding operations on the socket, and socket.shutdown() to cause any later writes to fail

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor

thanks @jzhu116-bloomberg. i don't think that cancel_after() would close the socket. as i understand it, that relates to per-op cancellation which only effects that one async op. in contrast, the current timeout_handler uses socket.cancel() to cancel all outstanding operations on the socket, and socket.shutdown() to cause any later writes to fail

Thanks @cbodley for the explanation. It looks like I trusted the wrong AI tool. Here is what I've got:

In the Boost.Asio ecosystem ...
The Sequence of Events:

  1. Cancellation Triggered: cancel_after sends the terminal signal.
  2. Socket Closed: The internal file descriptor is closed by the reactor (epoll/io_uring/select).
  3. Queue Flushing: The io_context identifies all outstanding completion handlers tied to that socket.
  4. Handler Invocation: On the next available turn of the event loop (when you call io_context.run()), those handlers are executed with the error code.

I didn't test or dig into the source code myself, which I probably should have. I trust you more on this, and will do some tests to confirm it myself.

@cbodley

cbodley commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

given something like this:

http::async_read_some(stream, buffer, parser, asio::cancel_after(10s, yield[ec]));

under the hood, this creates a cancellation_signal and associates a cancellation_slot with the wrapped completion token yield[ec]

a timeout from cancel_after() would request cancellation by cancellation_signal::emit(). if the operation is still in a state that can be canceled, it will cancel itself and schedule a completion handler on the associated executor with boost::asio::error::operation_aborted as its error code

that executor (somewhere inside of io_context.run()) would eventually invoke that completion handler, which would assign that error code to ec and resume the coroutine after http::async_read_some()

in simple cases, the calling coroutine would see that error and return early. if the asio socket object is on the stack of that coroutine, which it usually is, its destructor would run and call close()

rgw doesn't do a great job of differentiating between transport errors and others, so after a timeout reading from the socket we may still try to write a response. the call to shutdown() prevents that write from succeeding so that we go on to return from the coroutine and destroy the socket

@jzhu116-bloomberg

jzhu116-bloomberg commented Feb 26, 2026 •

Copy link
Copy Markdown
Contributor

given something like this:

http::async_read_some(stream, buffer, parser, asio::cancel_after(10s, yield[ec]));

under the hood, this creates a cancellation_signal and associates a cancellation_slot with the wrapped completion token yield[ec]

a timeout from cancel_after() would request cancellation by cancellation_signal::emit(). if the operation is still in a state that can be canceled, it will cancel itself and schedule a completion handler on the associated executor with boost::asio::error::operation_aborted as its error code

that executor (somewhere inside of io_context.run()) would eventually invoke that completion handler, which would assign that error code to ec and resume the coroutine after http::async_read_some()

in simple cases, the calling coroutine would see that error and return early. if the asio socket object is on the stack of that coroutine, which it usually is, its destructor would run and call close()

rgw doesn't do a great job of differentiating between transport errors and others, so after a timeout reading from the socket we may still try to write a response. the call to shutdown() prevents that write from succeeding so that we go on to return from the coroutine and destroy the socket

I did some tests on asio::cancel_after as the following (with boost v1.87), and confirmed that we will indeed have to manually call the socket.cancel() etc.

    asio::spawn(yield, [&](asio::yield_context y) {
        boost::system::error_code ec;

        std::size_t n = socket.async_read_some(
            asio::buffer(buf1),
            asio::cancel_after(std::chrono::seconds(2),
                asio::cancellation_type::terminal, // default
                asio::bind_cancellation_slot(slot, y[ec]))
        );      
    }); 
            
    if (ec == asio::error::operation_aborted) {
        socket->cancel();
        socket->shutdown(...);
    } else if (ec) {
    ...

Using asio::cancel_after(...) with http::async_* still has a little bit benefit:

  • With asio::cancel_after(...), only one completion handler will be dispatched, either the timeout one, or the http::async_* one. However in the current rgw implementation, both could potentially be dispatched at the same time. Queuing only one handler can make the logic slightly simpler and clearer, and also make it less likely to forget to handle asio::error::operation_aborted (due to timeout cancel or socket.cancel()) after each http::async_* call.
  • The timeout handler will be automatically dispatched to the same executor, as Oguzhan is trying to solve here.

@cbodley

cbodley commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

that looks reasonable. asio::cancel_after() does give us the option to pass our own timer variable so we could preserve the benefits of ceph::coarse_mono_clock

it may be simpler to just add a strand executor to what we have though?

@BBoozmen

Copy link
Copy Markdown
Contributor Author

have you been able to determine which of cancel() or shutdown() is not thread-safe?

As squid uses 1.82, looking at https://www.boost.org/doc/libs/1_82_0/doc/html/boost_asio/reference/basic_stream_socket.html; though, 1.87 doc reads the same

Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.

Synchronous send, receive, connect, and shutdown operations are thread safe with respect to each other, if the underlying operating system calls are also thread safe. This means that it is permitted to perform concurrent calls to these synchronous operations on a single socket object. Other synchronous operations, such as open or close, are not thread safe.

I think Shared objects: Unsafe is critical here. This would mean calling any member function on a socket while any other thread is calling any other member function (including async operations) is UB.

I couldn't determine which one but (from the tracker), it looks like it and last pointers contained ASCII data while last - it == 0x4000—suggests the socket's internal state or the buffer management got corrupted during concurrent access and then seems to have propagated to the beast parser.

i'm surprised that valgrind hasn't reported issues here

Yes, this is surprising but memcheck is not good at detecting data races? If it were use-after-free or invalid write into memory it'd have detected I believe but here corrupted memory buffer is corrupted in-flgiht data but yeslet me think through a bit whether we can better pin point. I think TSAN is better suited for this job.

i remember seeing that the strand executor had a noticeable performance cost so tried to avoid it

This is interesting but i think, just thinking about this change, in normal path timeout timer will be cancelled before it is fired so no strand dispatch happens. Since, this extra/new strand dispatch would happen in timeout, the overhead should be negligible i think. Moreover, the coroutime is already running on strand (make_strand(ctxt)) the new change will just re-use it.

RE: asio::cancel_after()
..
it may be simpler to just add a strand executor to what we have though?

I'd agree with that. The cancel_after approach is a good one but doesn't change/void the serialization requirement I believe. if the cancellation notification isn't serialized with the operation it's cancelling, the same race would exists. Additionally, cancel_after doesn't do shutdown(), which is intentional here to prevent half-open connections from continuing to send data I think?
I belive @jzhu116-bloomberg testing showed this already.

Let me take a look at TSAN option in the meantime.

@jzhu116-bloomberg

Copy link
Copy Markdown
Contributor

that looks reasonable. asio::cancel_after() does give us the option to pass our own timer variable so we could preserve the benefits of ceph::coarse_mono_clock

it may be simpler to just add a strand executor to what we have though?

Agree, using the strand is simpler in our case here. I rethink the entire workflow if both the timeout handler and the http::async_* completion handler are dispatched to the strand, it shouldn't add much cost, since whichever gets executed first will cancel the other. The only added cost here is an extra cycle to check the error code of the later-dispatched handler of the two. And the scenarios of both handlers are dispatched should be rare.

@BBoozmen

BBoozmen commented Feb 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Added a TSAN test in commit 2da62b049eba937edb41184c8a0b2d2ae159deff that tries to simulate what we'd be seeing in real life. To sum up,

Neither cancel() nor shutdown() is the issue here. Both are atomic syscalls. The race should be in the boost::beast HTTP parser's internal state.

When timeout_handler is fired on a different thread (when context.get_executor() is used), it calls socket.cancel() which triggers the coroutine to wake and continue parsing. However, the timeout handler and coroutine now race on shared Connection state: e.g., in the crash analyzed in the tracker, we saw the parser's it/last pointers corrupted with ASCII data ("IDJRZtX-").

Using yield.get_executor() makes sure the timeout handler is dispatched through the coroutine's strand, serializing all access to the connection and parser state. So, the new test shows

  1. Timer fires → timeout_handler is queued to the strand
  2. If coroutine is currently running on strand → handler waits in queue
  3. When coroutine yields (e.g., async_read(yield)) → strand picks up timeout_handler
  4. timeout_handler runs socket.cancel() → this marks pending async ops as cancelled
  5. timeout_handler completes → strand resumes coroutine
  6. Coroutine's async_read returns with error::operation_aborted

So, timeout_handler and coroutine never overlap - they take turns on the strand. The test reproduces the issue shows:

  1. Timer fires → timeout_handler dispatched to any thread in pool
  2. Meanwhile, coroutine is mid-parse on a different thread
  3. Both access Connection/parser state simultaneously → data race → crash

Bottomline, with the fix, the timeout_handler waits in the strand queue until the coroutine yields at an async operation (like async_read), then executes cancel()/shutdown(). The coroutine is never interrupted mid-parse.

BTW, running the test tsan_rgw_timeout_race, we see below tsan failure without the fix:

./tsan_rgw_timeout_race
TSAN Race Test for rgw_asio_frontend timeout_timer
Mode: both, Iterations: 20, Threads: 4

============= SHOULD FAIL: context.get_executor() =============
TSAN should report races here.
...
WARNING: ThreadSanitizer: data race (pid=143684)
...
    #113 make_fcontext <null> (tsan_rgw_timeout_race+0x5172e) (BuildId: 630d86c2f306fdd104abfd29a5b288a9f175ca77)
    #114 main /ceph-src/src/test/rgw/tsan_rgw_timeout_race.cc:204 (tsan_rgw_timeout_race+0x28c60) (BuildId: 630d86c2f306fdd104abfd29a5b288a9f175ca77)
...
SUMMARY: ThreadSanitizer: data race /ceph-src/src/test/rgw/tsan_rgw_timeout_race.cc:114 in operator()
==================
Done: 20/20

=== FIX: yield.get_executor() ===
TSAN should NOT report races here.

Done: 20/20

=== DONE ===

Line 114, e,g,

          conn->parser.bytes_parsed += 10;    // RACE with timeout_handler

Indeed what we expected to see race and tsan captured it.

Performance

Again. timer handler is meant to run serialized with the coroutine, while this change ensures it and the strand should add no overhead when there's no contention (which is the common case as timeout rarely fires).

@BBoozmen

BBoozmen commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

@cbodley / @jzhu116-bloomberg - Following up on this PR. To summarize where we are:

Added the TSAN test results in the previous comment demonstrating the race is in shared Connection/parser state, not in cancel()/shutdown() themselves. The timeout handler and coroutine access Connection concurrently when not serialized through the strand.

In terms of the next steps:

  • Should I add needs-qa to route this through teuthology?
  • Is there a QA performance test setup that could validate performance impact would be negligible under realistic RGW load?

Let me know if you'd like any additional analysis or if there are other approaches you'd prefer to explore.

@cbodley

cbodley commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Is there a QA performance test setup that could validate performance impact would be negligible under realistic RGW load?

@mkogan1 could you please offer some advice on measuring the difference in cpu usage here? would we just look at small object upload latency at sufficient scale? do you know if there's still hardware available in the upstream lab for performance testing?

@mkogan1
mkogan1 self-requested a review March 19, 2026 20:30
@mkogan1

mkogan1 commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

@cbodley sure - can review (currently have one beefy machine in the IBM cloud, will slot a test run for this next week) will try to run a hsbench 4KB PUTs at close to the 1000 rgw_max_concurrent_requests concurrency and monitor the Operations per sec & all the hsbnch latency percentile breakdown and monitor the RGW process CPU usage during the run (on main before and after this PR commits cherry-pick)
if any comments/suggestions/changes for the test methodology? please leave a note...

@cbodley

cbodley commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@cbodley sure - can review (currently have one beefy machine in the IBM cloud, will slot a test run for this next week) will try to run a hsbench 4KB PUTs at close to the 1000 rgw_max_concurrent_requests concurrency and monitor the Operations per sec & all the hsbnch latency percentile breakdown and monitor the RGW process CPU usage during the run (on main before and after this PR commits cherry-pick) if any comments/suggestions/changes for the test methodology? please leave a note...

thanks @mkogan1! you had done similar investigation in #43761 (comment) - i think the cpu usage graphs were very helpful there

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@cbodley

cbodley commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

@BBoozmen the unit tests were obviously helpful in investigating this issue, but i don't see a ton of value in merging them. it looks to me like they're just setting up a data race to verify that tsan identifies it. and because they aren't testing the same data race we saw and fixed in the frontend, it won't help us catch regressions there in the future

@BBoozmen
BBoozmen requested a review from a team as a code owner March 20, 2026 17:11
@BBoozmen

Copy link
Copy Markdown
Contributor Author

@BBoozmen the unit tests were obviously helpful in investigating this issue, but i don't see a ton of value in merging them. it looks to me like they're just setting up a data race to verify that tsan identifies it. and because they aren't testing the same data race we saw and fixed in the frontend, it won't help us catch regressions there in the future

Yeap, removed the testing commits.

@mkogan1

mkogan1 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

@cbodley sure - can review (currently have one beefy machine in the IBM cloud, will slot a test run for this next week) will try to run a hsbench 4KB PUTs at close to the 1000 rgw_max_concurrent_requests concurrency and monitor the Operations per sec & all the hsbnch latency percentile breakdown and monitor the RGW process CPU usage during the run (on main before and after this PR commits cherry-pick) if any comments/suggestions/changes for the test methodology? please leave a note...

thanks @mkogan1! you had done similar investigation in #43761 (comment) - i think the cpu usage graphs were very helpful there

@cbodley performed a habench run of 500000 4KB objs PUT using 1000 threads

echo ${RANDOM} ; time (nice numactl -N 0 -m 0 -- env GOMAXPROCS=$(( $(numactl -N 0 -- nproc) / 2 )) ~/go/bin/hsbench -a b2345678901234567890 -s b234567890123456789012345678901234567890 -u http://127.0.0.1:8000 -z 4K -d -1 -t 1000 -b $(( $(numactl -N 0 -- nproc) * 4 )) -n 500000 -m cxip -bp "b01b--${RANDOM}-" -op 'folder01/stage01_')

there does not seem to be a pronounced difference in CPU utilization on main without the PR cherry-pick (left side of graph) and with the PR cherry-pick (right side of the graph)

(the test system was not CPU/IO/MEM constrained during the run)
image

the performance of PUTs IO/s is also similar
image

@BBoozmen BBoozmen added the wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh label Mar 23, 2026

@mkogan1 mkogan1 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, as discussed in standup, no affect on performance is a good result

@BBoozmen

BBoozmen commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/bcs-ceph-2026-03-24_17:03:56-rgw-wip-oozmen-testing-2026-03-23-2115-distro-default-trial/ is the teuthology rgw suite submission. I sent another submission later (https://pulpito.ceph.com/bcs-ceph-2026-03-25_01:00:31-rgw-wip-oozmen-testing-2026-03-23-2115-distro-default-trial/detail), for some reason my --rerun failed so the full submission the 2nd time.

Comparing both runs, the high level result summary is very similar: Total Tests: 71 | Passed: 46 | Failed: 25 | Dead: 0

But, the tests-failed differ a bit which is good to eliminate some of the analysis I guess:

Test Suite Run 1 Failures Run 2 Failures Status
rgw/multisite 2 2 ✓ CONSISTENT
rgw/notifications 5 5 ✓ CONSISTENT
rgw/upgrade 4 4 ✓ CONSISTENT
rgw/verify 13 13 ✓ CONSISTENT
rgw/website 1 0 ⚠ FLAKY
rgw/d4n 0 1 ⚠ FLAKY

I think we can consider rgw/website and rgw/d4n as passed as there's at least 1 pass across 2 runs.

rgw/website

rgw/website: failed on ubuntu and passed on rocky.

  • Rocky:
2026-03-25T01:53:10.944 INFO:teuthology.orchestra.run.trial006.stdout:========== 764 passed, 4 skipped, 269 deselected in 326.94s (0:05:26) ==========
2026-03-25T01:53:11.000 INFO:teuthology.orchestra.run.trial006.stdout:  py: OK (333.38=setup[6.22]+cmd[327.16] seconds)
  • Ubuntu:
2026-03-24T19:01:18.221 INFO:teuthology.orchestra.run.trial040.stdout:========== 1 passed, 269 deselected, 767 errors in 5947.27s (1:39:07) ==========

Ubuntu run failed miserably due to DNS issue I think as the failure is

urllib3.exceptions.NameResolutionError: AWSHTTPConnection(host='s3.trial040.front.sepia.ceph.com', port=80): Failed to resolve 's3.trial040.front.sepia.ceph.com' ([Errno -2] Name or service not known)

Doesn't look an issue with the PR but more of an infrastructure issue.

rgw/d4n

rgw/d4n: passed on ubuntu and failed on rocky again due to failing to find the redis pkg:

2026-03-25T01:26:40.288 INFO:teuthology.orchestra.run.trial131.stderr:Error: Unable to find a match: redis

rgw/upgrade & rgw/verify

All 17 failures (4 upgrade + 13 verify) are exclusively on Rocky 10.1 and these suites pass for ubuntu. Rocky failures are due to missing dependencies: e.g.

teuthology.exceptions.VersionNotFoundError: Failed to fetch package version from https://shaman.ceph.com/api/search/?status=ready&project=ceph&flavor=default&distros=rocky%2F10%2Fx86_64&ref=squid

or

2026-03-24T17:24:17.061 INFO:teuthology.orchestra.run.trial014.stdout:E   ModuleNotFoundError: No module named 'boto.vendored.six.moves'

This is a known issue: https://tracker.ceph.com/issues/72500

These leave notification and multisite tests.

rgw/multisite

So, we have 4 multisite runs: 2 submissions x each 2 runs (ubuntu+rocky)...Looking at the failed testcases across 4 runs:

Test Failed OS Pattern Likely Cause
test_bucket_remove 100% (4/4) All OSes Known issue: https://tracker.ceph.com/issues/75465
test_bucket_log_trim_after_delete_bucket_secondary_reshard 50% (2/4) Both OSes also seems to be known issue https://tracker.ceph.com/issues/70858
test_copy_object_same_bucket 50% (2/4) Ubuntu only Passes on Rocky
test_copy_object_different_bucket 25% (1/4) Rocky (once) Timing/flaky issue

I don't see any open tracker for test_copy_object_same_bucket and test_copy_object_different_bucket but they seem flaky: at least 1 pass across 4 runs.

2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:======================================================================
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:FAIL: rgw_multi.tests.test_copy_object_same_bucket
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:Traceback (most recent call last):
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_teuthology_c5deb799f72d19919e24da00a297c31b33741ccf/virtualenv/lib/python3.12/site-packages/nose/case.py", line 170, in runTest
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:    self.test(*self.arg)
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/../src/test/rgw/rgw_multi/tests.py", line 4077, in test_copy_object_same_bucket
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:    zonegroup_bucket_checkpoint(zonegroup_conns, bucket.name)
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/../src/test/rgw/rgw_multi/tests.py", line 432, in zonegroup_bucket_checkpoint
2026-03-24T18:14:44.143 INFO:tasks.rgw_multisite_tests:    target_conn.check_bucket_eq(source_conn, bucket_name)
2026-03-24T18:14:44.144 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/tasks/rgw_multi/zone_rados.py", line 130, in check_bucket_eq
2026-03-24T18:14:44.144 INFO:tasks.rgw_multisite_tests:    check_object_eq(k1, k2)
2026-03-24T18:14:44.144 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/tasks/rgw_multi/zone_rados.py", line 50, in check_object_eq
2026-03-24T18:14:44.144 INFO:tasks.rgw_multisite_tests:    eq(k1.size, k2.size)
2026-03-24T18:14:44.144 INFO:tasks.rgw_multisite_tests:AssertionError: 5 != 3

and

2026-03-25T06:27:25.652 INFO:tasks.rgw_multisite_tests:======================================================================
2026-03-25T06:27:25.652 INFO:tasks.rgw_multisite_tests:FAIL: rgw_multi.tests.test_copy_object_different_bucket
2026-03-25T06:27:25.652 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-03-25T06:27:25.652 INFO:tasks.rgw_multisite_tests:Traceback (most recent call last):
2026-03-25T06:27:25.652 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_teuthology_c5deb799f72d19919e24da00a297c31b33741ccf/virtualenv/lib/python3.12/site-packages/nose/case.py", line 170, in runTest
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:    self.test(*self.arg)
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/../src/test/rgw/rgw_multi/tests.py", line 4110, in test_copy_object_different_bucket
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:    zonegroup_bucket_checkpoint(zonegroup_conns, dest_bucket.name)
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/../src/test/rgw/rgw_multi/tests.py", line 432, in zonegroup_bucket_checkpoint
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:    target_conn.check_bucket_eq(source_conn, bucket_name)
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/tasks/rgw_multi/zone_rados.py", line 130, in check_bucket_eq
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:    check_object_eq(k1, k2)
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_bf814e749831e99000b697c318b13d2c351f47c5/qa/tasks/rgw_multi/zone_rados.py", line 50, in check_object_eq
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:    eq(k1.size, k2.size)
2026-03-25T06:27:25.653 INFO:tasks.rgw_multisite_tests:AssertionError: 3 != 16

Maybe a timing issue - not waiting long enough to sync to complete but then there's only a few objects. E.g., looking at

2026-03-24T17:53:53.637 INFO:tasks.rgw_multi.zone_rados:comparing bucket=qmlenu-60 zones={test-zone2, test-zone1}
...
2026-03-24T17:53:53.770 INFO:tasks.rgw_multi.zone_rados:success, bucket identical: bucket=qmlenu-60 zones={test-zone2, test-zone1}

...

2026-03-24T17:54:03.973 INFO:tasks.rgw_multi.zone_rados:comparing bucket=qmlenu-60 zones={test-zone2, test-zone1}
...
2026-03-24T17:54:04.162 INFO:tasks.rgw_multi.zone_rados:success, bucket identical: bucket=qmlenu-60 zones={test-zone2, test-zone1}

...

2026-03-24T17:54:09.370 INFO:tasks.rgw_multi.zone_rados:comparing bucket=qmlenu-60 zones={test-zone2, test-zone1}
...
2026-03-24T17:54:09.479 DEBUG:tasks.rgw_multi.zone_rados:comparing key name=dummy-copy1
2026-03-24T17:54:09.556 DEBUG:tasks.rgw_multi.zone_rados:comparing key name=dummy-copy2
2026-03-24T17:54:09.610 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_copy_object_same_bucket ... FAIL

Time-window leading to fail is pretty small.

rgw/notification

Again, dependency issues are seen: 4 pytest failures (all same import error) and 1 erlang package failure (infrastructure)

File "test_bn.py", line 22
    from cloudevents.http import CloudEvent
ModuleNotFoundError: No module named 'cloudevents.http'

or

Command failed on trial122 with status 1: 'sudo dnf -y install erlang':
2026-03-25T01:38:47.852 INFO:teuthology.orchestra.run.trial131.stderr:Error: Unable to find a match: erlang

There's also Valgrind MismatchedFree errors seem to be happening on ROckey only?

Job ID OS Test Type Tests Collected Tests Run Passed Failed Primary Failure Secondary Issue
119854 Rocky 10.1 AMQP/RabbitMQ N/A 0 0 0 Erlang package missing Valgrind MismatchedFree
119870 Ubuntu 22.04 Kafka failover 0 / 1 error 0 0 0 cloudevents import error None
119883 Ubuntu 22.04 HTTP 0 / 1 error 0 0 0 cloudevents import error None
119896 Rocky 10.1 Kafka 0 / 1 error 0 0 0 cloudevents import error Valgrind MismatchedFree
119909 Rocky 10.1 Kafka failover 0 / 1 error 0 0 0 cloudevents import error Valgrind MismatchedFree

If no real tests ran, why the valgrind failure, though? And, why only on Rocky? Didn't analyze in deep but more than likely during prepare/shutdown phase and why Rocky only - maybe due to Rocky using different compliler/toolchain?

Next Steps

  • Open 2 trackers for 2 flaky multisite testcases...I don' think the failures are related to this PR; epsecially the one consistently failing on ubuntu.
  • We already have https://tracker.ceph.com/issues/72500 for rgw/verify & upgrade ragweed dependency failiure.
  • rgw/d4n: open a tracker to address redis dependency on rocky
  • rgw/notification + Rocky: open a tracker for erlang dependency
  • rgw/notification: open a tracker for cloudevents dependency
  • rgw/notification: valgrind errors - don't seem to be related to the notification functionality but I'll open a tracker why this is happening on Rocky.

@cbodley

cbodley commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Ubuntu run failed miserably due to DNS issue I think as the failure is

urllib3.exceptions.NameResolutionError: AWSHTTPConnection(host='s3.trial040.front.sepia.ceph.com', port=80): Failed to resolve 's3.trial040.front.sepia.ceph.com' ([Errno -2] Name or service not known)

Doesn't look an issue with the PR but more of an infrastructure issue.

thanks, i was confused by that ubuntu failure and hadn't seen it before. the rgw/website suite uses dnsmasq to set up wildcard dns names for s3. and s3-website. in https://github.com/ceph/ceph/blob/c9045e280d/qa/suites/rgw/website/tasks/s3tests-website.yaml#L4-L7, and i wrote the https://github.com/ceph/ceph/blob/c9045e280d/qa/tasks/dnsmasq.py task to support that. so we own this stuff, not the infra team

@cbodley

cbodley commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Failed to fetch package version from https://shaman.ceph.com/api/search/?status=ready&project=ceph&flavor=default&distros=rocky%2F10%2Fx86_64&ref=squid

this failure for rgw/upgrade is because it's trying to install nonexistent rocky10 packages for squid. i opened #68001 to address this, but it's still expected to fail due to boto2 without ceph/ragweed#29

@BBoozmen

Copy link
Copy Markdown
Contributor Author

thanks, i was confused by that ubuntu failure and hadn't seen it before. the rgw/website suite uses dnsmasq to set up wildcard dns names for s3. and s3-website. in https://github.com/ceph/ceph/blob/c9045e280d/qa/suites/rgw/website/tasks/s3tests-website.yaml#L4-L7, and i wrote the https://github.com/ceph/ceph/blob/c9045e280d/qa/tasks/dnsmasq.py task to support that. so we own this stuff, not the infra team

Hmm, let me also check (dig into logs a bit more) whether this warrants another tracker.

@cbodley

cbodley commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Hmm, let me also check (dig into logs a bit more) whether this warrants another tracker.

may be related to recent changes from #66625

@BBoozmen BBoozmen added wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh and removed wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh labels Apr 15, 2026
@BBoozmen

BBoozmen commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Re-tested this PR in the integration test branch https://github.com/ceph/ceph-ci/commits/wip-oozmen-testing-2026-04-16-0021/ which includes 5 PRs including this one:

Results are at https://pulpito.ceph.com/bcs-ceph-2026-04-16_11:07:58-rgw-wip-oozmen-testing-2026-04-16-0021-distro-default-trial/ which showed 5 failures and

Also took a look at another job from anrao19 as a baseline/comparison-point (which runs on ceph-ci branch https://github.com/ceph/ceph-ci/commits/wip-anrao10-testing-2026-04-14-1759/ which does not include the first 2 PRs but the other 3 of them: https://pulpito.ceph.com/anuchaithra-2026-04-15_04:52:32-rgw-wip-anrao10-testing-2026-04-14-1759-distro-default-trial/

At the high level:

Job Pass Fail Total
wip-oozmen-testing-2026-04-16-0021 67 5 72
wip-anrao10-testing-2026-04-14-1759 61 11 72
wip-oozmen-testing-2026-04-16-0021 (re-run) 3 2 5

Focusing on wip-oozmen-testing-2026-04-16-0021 5 failures:

Job ID Suite OS Failure Reason
155880 rgw/multisite ubuntu 22.04 1 out of 112 test failed: AssertionError: 3 != 16 -> https://tracker.ceph.com/issues/75716 (passed in re-run)
155891 rgw/verify ubuntu 22.04 Valgrind: memory leak in ProtocolV2::handle_message() → decode_message at cleanup (passed in re-run)
155913 rgw/bucket-logging rocky 10.1 1 of the s3tests failed: test_bucket_logging_cleanup_concurrent_updating_j (passed in re-run)
155936 rgw/notifications ubuntu 22.04 Cleanup failure: rmdir /home/ubuntu/cephtest failed on trial017 (exit 1)
155881 rgw/notifications rocky 10.1 git clone of branch failed on trial125 (exit 128) — test never started (passed in re-run)

multisite

centos -> two zones (passed):

2026-04-16T17:35:52.032 INFO:tasks.rgw_multisite_tests:Ran 56 tests in 2573.473s
2026-04-16T17:35:52.032 INFO:tasks.rgw_multisite_tests:
2026-04-16T17:35:52.032 INFO:tasks.rgw_multisite_tests:OK (SKIP=2)

ubuntu -> two zonegroups: 1 test (test_copy_object_different_bucket) failed (in re-run this testcase PASSED)

2026-04-16T16:57:45.326 INFO:tasks.rgw_multisite_tests:======================================================================
2026-04-16T16:57:45.326 INFO:tasks.rgw_multisite_tests:FAIL: rgw_multi.tests.test_copy_object_different_bucket
...
2026-04-16T16:57:45.327 INFO:tasks.rgw_multisite_tests:AssertionError: 3 != 16
2026-04-16T16:57:45.327 INFO:tasks.rgw_multisite_tests:
2026-04-16T16:57:45.327 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-04-16T16:57:45.327 INFO:tasks.rgw_multisite_tests:Ran 56 tests in 3087.636s
2026-04-16T16:57:45.327 INFO:tasks.rgw_multisite_tests:
2026-04-16T16:57:45.328 INFO:tasks.rgw_multisite_tests:FAILED (SKIP=2, failures=1)

Only 1 test (test_copy_object_different_bucket) failed and it's a known test: https://tracker.ceph.com/issues/75716.

Although above test passed in the re-run, 2 other tests failed:

...
2026-04-20T18:49:10.931 INFO:tasks.rgw_multisite_tests:rgw_multi.tests.test_copy_object_different_bucket ... ok
...
2026-04-20T19:03:08.713 INFO:tasks.rgw_multisite_tests:======================================================================
2026-04-20T19:03:08.713 INFO:tasks.rgw_multisite_tests:FAIL: rgw_multi.tests.test_bucket_log_trim_after_delete_bucket_secondary_reshard
...
2026-04-20T19:03:08.714 INFO:tasks.rgw_multisite_tests:    assert check_bucket_instance_metadata(zone.zone, test_bucket.name)
2026-04-20T19:03:08.714 INFO:tasks.rgw_multisite_tests:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-04-20T19:03:08.714 INFO:tasks.rgw_multisite_tests:AssertionError

INFO:tasks.rgw_multisite_tests:======================================================================
2026-04-20T19:03:08.714 INFO:tasks.rgw_multisite_tests:FAIL: rgw_multi.tests.test_copy_object_same_bucket
...
2026-04-20T19:03:08.715 INFO:tasks.rgw_multisite_tests:    check_object_eq(k1, k2)
2026-04-20T19:03:08.715 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_ceph-c_a919b53ee048cfa1eaf32bbb0300494bd0031f68/qa/tasks/rgw_multi/zone_rados.py", line 50, in check_object_eq
2026-04-20T19:03:08.715 INFO:tasks.rgw_multisite_tests:    eq(k1.size, k2.size)
2026-04-20T19:03:08.715 INFO:tasks.rgw_multisite_tests:AssertionError: 3 != 16
2026-04-20T19:03:08.715 INFO:tasks.rgw_multisite_tests:
2026-04-20T19:03:08.715 INFO:tasks.rgw_multisite_tests:----------------------------------------------------------------------
2026-04-20T19:03:08.716 INFO:tasks.rgw_multisite_tests:Ran 56 tests in 2898.866s
2026-04-20T19:03:08.716 INFO:tasks.rgw_multisite_tests:
2026-04-20T19:03:08.716 INFO:tasks.rgw_multisite_tests:FAILED (SKIP=2, failures=2)

They are also known/flaky issues tracked at

verify (re-run passed)

Only 1 of the 22 verify suites failed: https://pulpito.ceph.com/bcs-ceph-2026-04-16_11:07:58-rgw-wip-oozmen-testing-2026-04-16-0021-distro-default-trial/155891/

Post-teardown valgrind check failed otherwise all tests passed. Every test suite in this verify job completed cleanly. The job then went into teardown, and only then did valgrind fire the Leak_DefinitelyLost exception at 17:30 — purely a post-run memory check failure, not a functional test failure.

2026-04-16T17:28:18.524 INFO:teuthology.orchestra.run.trial023.stdout:= 1124 passed, 4 skipped, 572 deselected, 1122 warnings in 3277.55s (0:54:37) ==
2026-04-16T17:28:18.599 INFO:teuthology.orchestra.run.trial023.stdout:  py: OK (3284.34=setup[6.53]+cmd[3277.81] seconds)
2026-04-16T17:28:18.599 INFO:teuthology.orchestra.run.trial023.stdout:  congratulations :) (3284.35 seconds)
2026-04-16T17:28:18.624 DEBUG:tasks.s3tests:Scanning radosgw logs for leaked encryption keys...
...
2026-04-16T17:28:18.705 INFO:tasks.s3tests:Cleaning up boto...
...
2026-04-16T17:28:21.894 INFO:tasks.workunit:cleanup=True
...
2026-04-16T17:29:10.538 INFO:tasks.s3tests_java:S3 Tests Java: Cleaning up s3-tests-java...
...
2026-04-16T17:30:56.760 DEBUG:tasks.ceph:valgrind exception message: valgrind error: Leak_DefinitelyLost
2026-04-16T17:31:18.854 ERROR:teuthology.run_tasks:Manager failed: ceph
Traceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_teuthology_426ec63bc4a39bba882efb593125294667afc593/teuthology/run_tasks.py", line 160, in run_tasks
    suppress = manager.__exit__(*exc_info)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/teuthworker/src/git.ceph.com_ceph-c_a919b53ee048cfa1eaf32bbb0300494bd0031f68/qa/tasks/ceph.py", line 2001, in task
    with contextutil.nested(*subtasks):
  File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/teuthworker/src/git.ceph.com_teuthology_426ec63bc4a39bba882efb593125294667afc593/teuthology/contextutil.py", line 54, in nested
    raise exc[1]
  File "/home/teuthworker/src/git.ceph.com_teuthology_426ec63bc4a39bba882efb593125294667afc593/teuthology/contextutil.py", line 46, in nested
    if exit(*exc):
       ^^^^^^^^^^
  File "/usr/lib/python3.12/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/home/teuthworker/src/git.ceph.com_ceph-c_a919b53ee048cfa1eaf32bbb0300494bd0031f68/qa/tasks/ceph.py", line 346, in valgrind_post
    raise valgrind_exception
Exception: valgrind error: Leak_DefinitelyLost
operator new[](unsigned long)
decode_message(ceph::common::CephContext*, int, ceph_msg_header&, ceph_msg_footer&, ceph::buffer::v15_2_0::list&, ceph::buffer::v15_2_0::list&, ceph::buffer::v15_2_0::list&, boost::intrusive_ptr<Connection>)
ProtocolV2::handle_message()

I believe ProtocolV2 is the internal Ceph messenger protocol, not the HTTP/S3 frontend related so I don't think this failure is related to any of the included PRs. Moreover, the re-run passed.

rgw/bucket-logging failure (passed in re-run)

rgw/bucket-logging -> EC -> rocky -> PASSED
(passed in re-run) rgw/bucket-logging -> replicated -> rocky -> FAILED -> https://pulpito.ceph.com/bcs-ceph-2026-04-16_11:07:58-rgw-wip-oozmen-testing-2026-04-16-0021-distro-default-trial/155913/

For the replicated pool run, just 1 test fails: test_bucket_logging_cleanup_concurrent_updating_j

2026-04-16T16:50:33.152 INFO:teuthology.orchestra.run.trial144.stdout:FAILED s3tests/functional/test_s3.py::test_bucket_logging_cleanup_concurrent_updating_j
2026-04-16T16:50:33.152 INFO:teuthology.orchestra.run.trial144.stdout:==== 1 failed, 110 passed, 926 deselected, 16 warnings in 203.43s (0:03:23) ====

Looks like the issue is related to Journal + concurrent config update path:

  • when 5 threads simultaneously trigger put_bucket_logging (which flushes pending records) for 5 buckets: The 5 concurrent threads each call put_bucket_logging on one of these buckets simultaneously,
test-nkjffqtz1urk497ehaz8g3in-758
test-nkjffqtz1urk497ehaz8g3in-759
test-nkjffqtz1urk497ehaz8g3in-760 ← assertion fails for this one
test-nkjffqtz1urk497ehaz8g3in-761
test-nkjffqtz1urk497ehaz8g3in-762
  • the Journal flush for bucket -760 races with the other threads' flushes?

I think EC case passes because writes are slower? I think re-run shows this is due to race across these 5 threads and not-related to this PR.

rgw/notifications

2 of the 5 notifications suites show FAILED.

(failed the same way in re-run) rgw/notifications -> test_kafka: actually tests passed and again clean up issue so can be ignored I think for the purposes of evaluating this PR:

2026-04-16T17:08:40.985  ================= 2 passed, 79 deselected in 90.91s ==================
..
2026-04-16T17:10:13.986  rmdir: failed to remove '/home/ubuntu/cephtest': Directory not empty

(passed in re-run) rgw/notifications -> test_ampq: task setup failed:

fatal: unable to access 'https://git.ceph.com/ceph-ci.git/': Could not resolve host: git.ceph.com
CommandFailedError: Command failed on trial125 with status 128:
  'git clone -b wip-oozmen-testing-2026-04-16-0021 https://git.ceph.com/ceph-ci.git /home/ubuntu/cephtest/ceph'

Conclusion

I believe the failures mentioned above are not directly relevant to this PR.

@cbodley - would you mind taking a look at the test results real quick? I believe this is ready-to-merge.

@BBoozmen BBoozmen removed the wip-oozmen-testing for teuthology integration testing to be used via build-integration-branch.sh label Apr 20, 2026
@cbodley
cbodley merged commit 5ad386a into ceph:main Apr 20, 2026
6 checks passed
@cbodley

cbodley commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

tyvm @BBoozmen @jzhu116-bloomberg @mkogan1 for all the hard work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants