Repository navigation
rgw: Fix crashes on realm reload - #68920
Conversation
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
BBoozmen
left a comment
There was a problem hiding this comment.
Commits 1–7 look good. the io_context_pool init fix (commit 5) is a subtle catch, and I think the drain+restart on realm reload (commit 7) complements #66369.
Regarding commit 8 (strand-dispatched socket.close()): the pending #69713 addresses the same race differently: it replaces socket.close() with cancel() + shutdown(), similar to the approach added in the timeout handler #50131. This avoids releasing the fd from ConnectionList::close() entirely, so the race doesn't exist regardless of calling context.
Both approaches are functionally complementary (strand serialization + non-destructive shutdown), but either one alone ?may? be sufficient to fix such crashes. So, if #69713 lands in, commit 8 may become redundant.
@adamemerson / @cbodley - would you prefer one approach over the other, or should/can both go in?
if there isn't a huge cost, I don't object to redundant fixes. |
Agreed. Having both won't be really redundant I think...One serializes the operation on the connection's strand, and the other makes it a graceful shutdown by using cancel+shutdown instead of close, and relying on RAII to clear the connections list instead of explicit clear(). The only cost is some minor merge conflict resolution when the second to go in will need to rebase. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
Having got a crash in the testing, I'm going to put |
60de401 to
ce3dfb3
Compare
|
jenkins test make check arm64 |
Without this we can end up in an infinite loop where we just fill the log with -ECANCELED from `get_next()`. Duplicates a check in the `blocked_operations` loop. Fixes: https://tracker.ceph.com/issues/76094 Signed-off-by: Adam C. Emerson <[email protected]>
To prevent a race condition/crash on realm reload where sync was trying to put objects through quota before quota was initialized. Fixes: https://tracker.ceph.com/issues/76094 Fixes: https://tracker.ceph.com/issues/77883 Signed-off-by: Adam C. Emerson <[email protected]>
This is essentially a special case of an optional and it should act like one. I asked the original author to updated it but they didn't want to, so I did it myself. Fixes: https://tracker.ceph.com/issues/76094 Signed-off-by: Adam C. Emerson <[email protected]>
Previously if we received an rvalue function object we would call a moved-from object on all but the first thread. In practice this didn't cause an issue, but only because of the functions we were passing. Fixes: https://tracker.ceph.com/issues/76094 Signed-off-by: Adam C. Emerson <[email protected]>
AsioFrontend::pause() (and stop()) call ConnectionList::close() from the realm reloader thread. That invokes socket.close() on every live connection from a thread that isn't the connection's asio strand, so the reactor deregisters each socket's descriptor_state racing against the coroutine that handles the connection. If a keep-alive connection is starting its next async_read_some() on its strand at the same time, epoll_reactor::start_op() dereferences the descriptor_state that close has already freed and radosgw segfaults in an io_context_pool thread. This matches the race pattern fixed for timeout_timer in 86ad0b8: any caller that touches socket state from outside the strand needs to be serialized with the coroutine. Store the coroutine's strand executor on Connection and dispatch the close onto that strand in ConnectionList::close(). The lambda captures an intrusive_ptr to Connection so the object lives until the close actually runs, since connections.clear() unlinks the list entry right after dispatch. Tracker: https://tracker.ceph.com/issues/76094 Signed-off-by: Lumir Sliva <[email protected]> Update `unittest_rgw_asio_frontend` to run the `io_context` and execute in a coroutine to match the environment in RGW. Signed-off-by: Adam C. Emerson <[email protected]>
|
jenkins test windows |
Collection of fixes relevant to reload and shutdown.
Fixes: https://tracker.ceph.com/issues/76094
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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.