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

librados: fix resources leakage in RadosClient::connect() #3828

Merged
2 commits merged into from Mar 11, 2015
Merged

librados: fix resources leakage in RadosClient::connect() #3828

2 commits merged into from Mar 11, 2015

Conversation

ghost
Copy link

@ghost ghost commented Feb 27, 2015

http://tracker.ceph.com/issues/10425

corresponding master pull request #3513

If RadosClient::connect was called a second time (which could
happen as a part of recovery from failure), the instances
of Objecter and Messenger allocated by the first call were leaked.

Additionally, the implementation of the method wrongly reported
memory allocation problems -- it throwed std::bad_alloc exception
instead of returning -ENOMEM error code.

Fixes: #10425
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
(cherry picked from commit 624c056)

Conflicts:
	src/librados/RadosClient.cc
        resolve adding (std::nothrow) that failed because the
        prototype of the constructor is not the same
RadosClient::wait_for_osdmap() did not signalize lack of connection
via -ENOTCONN error code when the Objecter instance was allocated.
The proper way is to check the connection state explicitly.

Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
(cherry picked from commit 34473f7)

Conflicts:
	src/librados/RadosClient.cc
        the modified guard was not present: add the new guard instead
        of modifying it
@ghost ghost added bug-fix core labels Feb 27, 2015
@ghost ghost added this to the firefly milestone Feb 27, 2015
@ghost
Copy link
Author

ghost commented Feb 27, 2015

@rzarzynski does this backport look right to you ?

@ghost ghost self-assigned this Feb 27, 2015
@loic-bot
Copy link

SUCCESS: the output of run-make-check.sh on centos-centos7 for f70222c is http://paste2.org/_4XVJg3Ca

:octocat: Sent from GH.

@rzarzynski
Copy link
Contributor

@dachary it looks fine in my opinion.

ghost pushed a commit that referenced this pull request Mar 11, 2015
librados: fix resources leakage in RadosClient::connect()

Reviewed-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
@ghost ghost merged commit baa74b8 into ceph:firefly Mar 11, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants