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

osdc: clean up osd_command/start_mon_command interfaces #13727

Merged
merged 6 commits into from Mar 13, 2017

Conversation

Projects
None yet
4 participants
@jcsp
Contributor

jcsp commented Mar 1, 2017

Functions that can't return errors should return void. I was using these interfaces from #13725 and didn't like writing in even more places where we would either assert(r==0) or do an error handling branch that would never get taken.

@jcsp jcsp added cleanup core labels Mar 1, 2017

@liewegas liewegas changed the title from Clean up osd_command/start_mon_command interfaces to osdc: up osd_command/start_mon_command interfaces Mar 1, 2017

@liewegas

This comment has been minimized.

Member

liewegas commented Mar 1, 2017

/home/jenkins-build/build/workspace/ceph-pull-requests/src/librados/RadosClient.cc: In member function ‘int librados::RadosClient::osd_command(int, std::vector<std::basic_string >&, const bufferlist&, ceph::bufferlist*, std::string*)’:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/librados/RadosClient.cc:890:48: error: void value not ignored as it ought to be
new C_SafeCond(&mylock, &cond, &done, &ret));

@jcsp

This comment has been minimized.

Contributor

jcsp commented Mar 1, 2017

Oops, some of this got lost in another commit on #13725, fixing...

@tchaikov tchaikov added the needs-qa label Mar 2, 2017

@liewegas liewegas changed the title from osdc: up osd_command/start_mon_command interfaces to osdc: clean up osd_command/start_mon_command interfaces Mar 6, 2017

return client->osd_command(osdid, cmdvec, inbl, outbl, outs);
client->osd_command(osdid, cmdvec, inbl, outbl, outs);
return 0;

This comment has been minimized.

@liewegas

liewegas Mar 6, 2017

Member

this is eating the return value

This comment has been minimized.

@tchaikov

tchaikov Mar 9, 2017

Contributor

i concur with @liewegas

@jcsp this breaks this test:

2017-03-08T15:57:53.322 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: [ RUN      ] LibRadosCmd.OSDCmdPP
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: /build/ceph-12.0.0-1141-gc7d986e/src/test/librados/cmd.cc:146: Failure
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: Value of: r == -22 || r == -ENXIO
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd:   Actual: false
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: Expected: true
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: [  FAILED  ] LibRadosCmd.OSDCmdPP (15 ms)

see http://qa-proxy.ceph.com/teuthology/yuriw-2017-03-08_15:50:57-rados-wip-yuri-testing_2017_3_8---basic-smithi/895796/teuthology.log

@yuriw

if (ret) {
return ret;
}
client.mon_command(cmd, inbl, &outbl, &outstring);

This comment has been minimized.

@liewegas

liewegas Mar 6, 2017

Member

this one too

@liewegas

Objecter calls changed; the RadosClient ones didn't

return client->osd_command(osdid, cmdvec, inbl, outbl, outs);
client->osd_command(osdid, cmdvec, inbl, outbl, outs);
return 0;

This comment has been minimized.

@tchaikov

tchaikov Mar 9, 2017

Contributor

i concur with @liewegas

@jcsp this breaks this test:

2017-03-08T15:57:53.322 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: [ RUN      ] LibRadosCmd.OSDCmdPP
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: /build/ceph-12.0.0-1141-gc7d986e/src/test/librados/cmd.cc:146: Failure
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: Value of: r == -22 || r == -ENXIO
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd:   Actual: false
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: Expected: true
2017-03-08T15:57:53.323 INFO:tasks.workunit.client.0.smithi156.stdout:                  api_cmd: [  FAILED  ] LibRadosCmd.OSDCmdPP (15 ms)

see http://qa-proxy.ceph.com/teuthology/yuriw-2017-03-08_15:50:57-rados-wip-yuri-testing_2017_3_8---basic-smithi/895796/teuthology.log

@yuriw

jcsp added some commits Feb 4, 2017

osdc: make Objecter::osd_command return void
The int return was misleading because it didn't
really have any error cases.  We sometimes use
ints in APIs in case we want to return an error
in future, but Objecter is an internal interface.

Signed-off-by: John Spray <john.spray@redhat.com>
mon: make MonClient::start_mon_command return void
The int return was misleading because it didn't
really have any error cases.  We sometimes use
ints in APIs in case we want to return an error
in future, but MonClient is an internal interface.

Signed-off-by: John Spray <john.spray@redhat.com>
librados: update for osd_command/mon_command void change
Signed-off-by: John Spray <john.spray@redhat.com>
osdc: cmd arg should be const on Objecter::send_command
Signed-off-by: John Spray <john.spray@redhat.com>
osd: update for mon_command void change
Signed-off-by: John Spray <john.spray@redhat.com>
mgr: update for start_mon_command int->void
Signed-off-by: John Spray <john.spray@redhat.com>
@jcsp

This comment has been minimized.

Contributor

jcsp commented Mar 12, 2017

This is hopefully good now

@liewegas liewegas merged commit b1261e0 into ceph:master Mar 13, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment