Repository navigation
Conversation
This commit fixes a potential segfault risk when rgw timeout handler works on the socket in one thread while it is concurrently used by another. The details of the fix are: 1. Instead of calling socket close(), which resets descriptor_data in boost::asio socket and risks segfault due to concurrent use of the socket, the timeout handler now calls cancel() to abort all pending ops followed by shutdown() to disable the underlying transport. The eventual closure of the socket will be done in the socket destructor. 2. Expose the actual boost::asio socket via get_socket() from Connection so that the timeout handler can call cancel() and shutdown() on it, although the socket data member is already accessible. It allows future expansion that wants to hide the socket even though it renders the existing close() less useful. Fixes: https://tracker.ceph.com/issues/58670 Signed-off-by: Yixin Jin <[email protected]>
cbodley
approved these changes
Feb 15, 2023
Contributor
maybe a regardless, i'm happy to take the fix asap and follow up on this later |
Member
4 of 14 tasks
This was referenced Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit fixes a potential segfault risk when rgw timeout handler works on the socket in one thread while it is concurrently used by another. The details of the fix are:
Instead of calling socket close(), which resets descriptor_data in boost::asio socket and risks segfault due to concurrent use of the socket, the timeout handler now calls cancel() to abort all pending ops followed by shutdown() to disable the underlying transport. The eventual closure of the socket will be done in the socket destructor.
Expose the actual boost::asio socket via get_socket() from Connection so that the timeout handler can call cancel() and shutdown() on it, although the socket data member is already accessible. It allows future expansion that wants to hide the socket even though it renders the existing close() less useful.
Fixes: https://tracker.ceph.com/issues/58670
Signed-off-by: Yixin Jin [email protected]
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist