Project

General

Profile

Actions

Bug #21621

closed

async_msgr: bind must be called before registering any dispatcher

Added by Ricardo Dias over 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
msgr
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

While building a small client/server example using the Ceph messenger classes, I found that if I register a dispatcher before calling the "Messenger::bind" method on the messenger, the messenger will start the connection processor before having a server socket initialized and will not process any incoming connections on the server socket that is later initialized in the "Messenger::bind" method.

I think this is a weird behavior because I think the most intuitive behavior would be for the programmer to add the dispatchers before binding the messenger to an address.

Is there a good reason for the current behavior? or is this a bug?

Actions #1

Updated by Haomai Wang over 6 years ago

there exists legacy reason about this. we want to have a quick fail when binding failed instead of exited background.

maybe it's a feature to implement your hope

Actions #2

Updated by Haomai Wang over 6 years ago

Oh, sorry. I misunderstand the description just now.

YES, you could call Messenger::start instead of bind

Actions #3

Updated by Ricardo Dias over 6 years ago

Haomai Wang wrote:

Oh, sorry. I misunderstand the description just now.

What I meant was:
When we register a dispatcher before calling "bind", no messages will be processed by the dispatcher. Is this a bug or is this the intended behavior?

Actions #4

Updated by Sage Weil over 6 years ago

I think it's an oversight. It doesn't matter for most daemons: they don't expect any messages until they've started up and registered themselves with the monitors, so dropping stray messages before that is irrelevant.

For the mons it is a bit nonintuitive, but also harmless, since the mons are written to expect a stream of messages intended for predecessors and will still behave.

Actions #5

Updated by Ricardo Dias over 6 years ago

  • Status changed from New to Closed

I agree that this behavior does not cause any harm to the current Ceph daemons.

I'll close this issue.

Actions #6

Updated by Greg Farnum about 5 years ago

  • Project changed from RADOS to Messengers
Actions

Also available in: Atom PDF