The fault() call in connect should not set onread=true since connect is
effectively a write path. This was forcing the writer() into a tight
loop that repeatedly would call connect(); not very polite.
Changing that, we want to avoid treating this as a normal fault (with the
failure callback) and instead back off.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
pipe_lock.Lock();
fail_locked:
if (state == STATE_CONNECTING)
- fault(true);
+ fault();
else
ldout(msgr->cct,3) << "connect fault, but state = " << get_state_name()
<< " != connecting, stopping" << dendl;
shutdown_socket();
// lossy channel?
- if (policy.lossy) {
+ if (policy.lossy && state != STATE_CONNECTING) {
ldout(msgr->cct,10) << "fault on lossy channel, failing" << dendl;
stop();