-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TaskFinisher: cancel all tasks wait until finisher done #9682
Conversation
fdfbf1f
to
53a9c8e
Compare
@yuyuyu101 The caller for |
ok, @dillaman the other thing is now TaskFinisher is shared by multi images, but if unregister ImageWatcher(https://github.com/ceph/ceph/blob/master/src/librbd/ImageWatcher.cc#L123), we will cancel all pending events. Is this make sense? Do we need to only revoke task as this image queued? |
@yuyuyu101 Yes -- it should only cancel events associated with the current TaskFinisher instance. |
Oh, sorry. I forget we only share finisher not TaskFinisher instance.. |
53a9c8e
to
45354be
Compare
done @dillaman |
@@ -137,8 +139,6 @@ void ImageWatcher::unregister_watch(Context *on_finish) { | |||
m_watch_state = WATCH_STATE_UNREGISTERED; | |||
} | |||
} | |||
|
|||
on_finish->complete(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to activate C_Gather
45354be
to
60a80ac
Compare
The C_Gather needs to asynchronously callback the caller to avoid a potential recursive lock race:
Example:
|
Otherwise, caller may think pending task won't be executed but actually finisher may execute callback which may cause refer to freed object. Signed-off-by: Haomai Wang <haomai@xsky.com>
60a80ac
to
40c5679
Compare
retest this please |
@dillaman not sure jenkins error related(https://jenkins.ceph.com/job/ceph-pull-requests/7366/console). |
Otherwise, caller may think pending task won't be executed but actually
finisher may execute callback which may cause refer to freed object.
Signed-off-by: Haomai Wang haomai@xsky.com