Comment 9 for bug 1628906

Revision history for this message
Kota Tsuyuzaki (tsuyuzaki-kota) wrote :

Looking back at the irc log[1], the memory leak related to sort of sockets at reconstructor is still there? If true, I'm doubting the socket in ssync_server, I'm not sure for now though. The trial patch is with as attachment. The reason why I think this could resolve the socket leak is we got similar unclosed socket at Proxy-server which is resolved at [2][3]. To describe the bug a bit, when using swift.common.utils.BufferedHTTPConnection for the connection and once the process got the response, IIRC, we should either set None to resposne or call response.close() to release the reference for the backend socket. However, sssync_sender just calling self.connection.close() in the disconnected method.

In broken sync protocol, ssync_sender can call response.close() somewhere. However, some error cases (e.g. OSError (broken pipe) at connection.send() seems to fall into the disconnect method and IIUC, it cannot close anything. (maybe it will be closed after TIMEOUT seconds) anyway, we need more tests for this assumption.

I think Alistair or Samuel knows more detail around there.

1: http://eavesdrop.openstack.org/irclogs/%23openstack-swift/%23openstack-swift.2016-09-30.log.html#t2016-09-30T10:55:09
2: https://github.com/openstack/swift/blob/master/swift/proxy/controllers/obj.py#L1551-L1554
3: https://bugs.launchpad.net/swift/+bug/1594739