Merged
Conversation
src/rgw/rgw_http_client.cc
Outdated
| all_reqs.insert(iter.second); /* can't call _finish_request() on iter.second, it will modify reqs */ | ||
| } | ||
| for (auto iter : all_reqs) { | ||
| _finish_request(iter, -ECANCELED); |
Contributor
There was a problem hiding this comment.
good catch! i'll pull this into my testing branch
though it might be simpler to do something like this:
while (!reqs.empty()) {
_finish_request(reqs.begin()->second, -ECANCELED);
}
alternatively, you could move reqs into a temporary and loop over that:
auto all_reqs = std::move(reqs); // prevent _finish_request() from removing reqs during the loop
for (auto iter : all_reqs) {
Member
Author
There was a problem hiding this comment.
@cbodley yeah, seems more elegant. I wouldn't go for the while (!reqs.empty()) solutions, because it relies on _finish_request() to do the right thing (which doesn't remove it directly, but calls _complete_request()).
Contributor
|
With these fixes, I've been unable to reproduce the segfaults and multisite tests are passing consistently. |
4fa4f0b to
60429c3
Compare
It doesn't make sense to update it earlier, the zone that follows will not sync before it sees the completion. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
can't call _finish_request() on iter->second when iterating, it clobbers the map. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
and drop the cr when worker is done. The cr can be cleaned before worker is done, so we should have it stick around as long as the worker is alive. Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Member
Author
|
@cbodley reworked commit following your comment, added another fix to a separate issue |
Contributor
|
lgtm |
yehudasa
added a commit
that referenced
this pull request
Mar 17, 2016
Wip rgw sync fixes 3 Reviewed-by: Casey Bodley <cbodley@redhat.com>
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.
No description provided.