Skip to content
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-mirror: workaround for intermingled lockdep singletons #8476

Merged
merged 1 commit into from Apr 7, 2016

Conversation

dillaman
Copy link

@dillaman dillaman commented Apr 6, 2016

If librados constructs the CephContext, lockdep will be initialized
in both the librados shared address space and also within the app
address space. This breaks lockdep's functionality and results in
a crash upon shutdown.

Signed-off-by: Jason Dillaman dillaman@redhat.com

@dillaman dillaman added this to the jewel milestone Apr 6, 2016
@dillaman
Copy link
Author

dillaman commented Apr 6, 2016

@trociny @rjfd FYI -- after some digging, I created this workaround for the lockdep issues. Short term I think this will resolve the crashes on shutdown when lockdep is enabled.

@rjfd
Copy link
Contributor

rjfd commented Apr 6, 2016

@dillaman lgtm --- already tested and the assertion failure is no more.
I was wondering if the only option to make lockdep truly singleton would be to make it a library on its own.

@dillaman
Copy link
Author

dillaman commented Apr 6, 2016

@rjfd Yeah -- we run into lots of issues due to dual linkage of libcommon/libosdc/etc in librados and librbd/other apps.

@jdurgin
Copy link
Member

jdurgin commented Apr 7, 2016

This reminds me we might want to use CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS for common_preinit() to get logs and asok by default for the remote cluster too.

@trociny
Copy link
Contributor

trociny commented Apr 7, 2016

@dillaman Good idea, but there is an issue with the patch: by some reason command line options are not applied. You can see this running rbd_mirror.sh with NOCLEANUP, and observe that asok and log files are not created in tmp directory but in run/cluster2/out directory (as specified in cluster2.conf).

So far I have failed to understand why.

return r;
}

if (!m_args.empty()) {
r = m_remote->conf_parse_argv(m_args.size(), &m_args[0]);
// librados::Rados::conf_parse_argv
r = cct->_conf->parse_argv(args);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dillaman s/args/m_args/ :-)

If librados constructs the CephContext, lockdep will be initialized
in both the librados shared address space and also within the app
address space.  This breaks lockdep's functionality and results in
a crash upon shutdown.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
@dillaman
Copy link
Author

dillaman commented Apr 7, 2016

Updated and fixed -- thx.

@trociny
Copy link
Contributor

trociny commented Apr 7, 2016

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants