Randomly select simple or async, for testing purposes.
Signed-off-by: Sage Weil <sage@redhat.com>
string lname,
uint64_t nonce)
{
- if (cct->_conf->ms_type == "simple")
+ int r = -1;
+ if (cct->_conf->ms_type == "random")
+ r = rand() % 2;
+ if (r == 0 || cct->_conf->ms_type == "simple")
return new SimpleMessenger(cct, name, lname, nonce);
- else if (cct->_conf->ms_type == "async")
+ else if (r == 1 || cct->_conf->ms_type == "async")
return new AsyncMessenger(cct, name, lname, nonce);
lderr(cct) << "unrecognized ms_type '" << cct->_conf->ms_type << "'" << dendl;
return NULL;