Bug #21621
closedasync_msgr: bind must be called before registering any dispatcher
0%
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?
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
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
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?
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.
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.
Updated by Greg Farnum about 5 years ago
- Project changed from RADOS to Messengers