Andrew Stitcher wrote:
I'm interested in opinions as to the correct behaviour for QPID-2395:
https://issues.apache.org/jira/browse/QPID-2395

The real question IMO hinges on whether copying a Connection is
allowed/makes sense.

If copying a connection isn't allowed then closing the underlying socket
on Connection destruction should be the way to go.

If copying a Connection makes sense then I think we do need a way to
close the underlying socket when the last connection closes.

What would copying a connection (other than just copying a ref) mean?

I don't think that relying on Connection.close is a very safe strategy.

FWIW in Java and Python I would consider it a programming error to not explicitly call Connection.close(). This is partly because in Java and Python you can't depend on deterministic destructor behavior, but I do vaguely recall some subtle cpp bug a while back that was due to over dependence on destructors doing cleanup.

What do the rest of you think? How does this happen in python?

The analogous code in python would also leak file descriptors. In fact it would leak the whole connection object because the client's I/O thread will have a pointer to it until you explicitly call close.

--Rafael

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to