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
rbd-nbd: restart parent process logger after forking #12222
Conversation
Fixes: http://tracker.ceph.com/issues/18070 Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@@ -493,8 +493,9 @@ static int do_map() | |||
} | |||
|
|||
if (forker.is_parent()) { | |||
global_init_postfork_start(g_ceph_context); |
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.
maybe we can move this line out above if (forker.is_parent())
block, so it always gets called after fork()
? and remove the call at line 636 in the if (g_conf->daemonize)
block. so both child and parent's logger can be started, and can be stopped properly by the dtor of g_ceph_context
?
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.
The daemon process fails if you do that -- this is what works.
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.
i tested the proposed using rbd-nbd map rbd
, it does not crash. maybe i am missing something?
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.
Crashing is one thing (which should have been tested before the breaking commit was merged), but passing all the tests is another (rbd-nbd workunit and fsx in nbd mode).
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.
For me both versions look working. Anyway, I think the current initialization code in do_map already a bit confusing and it would be nice to try clean it up (as a separate PR, I could try this), so now any version that just fixes the issue could be ok.
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.
@dillaman oic! i will try to run the rbd tests next time when i am touching rbd related code.
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.
@tchaikov Thanks! Yes, please changes to RBD should be tested and reviewed.
rbd-nbd: restart parent process logger after forking #12222
Fixes: http://tracker.ceph.com/issues/18070
Signed-off-by: Jason Dillaman dillaman@redhat.com