forked from vitalif/vitastor
Add missing cancel_op(currently being read op) when stopping a client
Fixes client hangs possible after stopping & restarting an osd. Hangs happened when a connection was closed in the middle of reading a READ operation reply from the network. In this case the operation being read was in read_op and the client didn't free it when closing the connection. Test case for msgr_read.cpp: - Partially read reply for a READ operation - stop_client() - Check that the READ operation returns EPIPE The bug was actually introduced in 0.5.11.non-odp-rdma
parent
218e294e9c
commit
4047ca606f
|
@ -111,6 +111,10 @@ void osd_messenger_t::stop_client(int peer_fd, bool force, bool force_delete)
|
||||||
{
|
{
|
||||||
delete cl->read_op;
|
delete cl->read_op;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cancel_op(cl->read_op);
|
||||||
|
}
|
||||||
cl->read_op = NULL;
|
cl->read_op = NULL;
|
||||||
}
|
}
|
||||||
if (cl->osd_num)
|
if (cl->osd_num)
|
||||||
|
|
Loading…
Reference in New Issue