mirror of
https://github.com/ceph/ceph
synced 2025-01-31 15:32:38 +00:00
msg/Pipe: associate sending msgs to con inside lock
Associate a sending message with the connection inside the pipe_lock. This way if a racing thread tries to steal these messages it will be sure to reset the con point *after* we do such that it the con pointer is valid in encode_payload() (and later). This may be part of #3678. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
2a1eb466d3
commit
a058f16113
@ -1466,13 +1466,14 @@ void Pipe::writer()
|
||||
sent.push_back(m);
|
||||
m->get();
|
||||
}
|
||||
pipe_lock.Unlock();
|
||||
|
||||
ldout(msgr->cct,20) << "writer encoding " << m->get_seq() << " " << m << " " << *m << dendl;
|
||||
|
||||
// associate message with Connection (for benefit of encode_payload)
|
||||
m->set_connection(connection_state->get());
|
||||
|
||||
pipe_lock.Unlock();
|
||||
|
||||
ldout(msgr->cct,20) << "writer encoding " << m->get_seq() << " " << m << " " << *m << dendl;
|
||||
|
||||
// encode and copy out of *m
|
||||
m->encode(connection_state->get_features(), !msgr->cct->_conf->ms_nocrc);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user