Repository navigation
Conversation
|
There was an issue with test_6_cleanup in test_client failing. I fixed that by adding a "del" to transport's close. Transport has a cyclic reference with packetizer. This means that letting transport fall out of scope is not enough to have it GC'd and close must be explicitly called. |
|
Yes I discovered the issue in python 3 and using my patched version have
|
|
Could you push a commit with that if-return thingy removed and see if we fail or succeed on travis? |
|
I ran the tests locally and it fails for python 3 so maybe there is an issue. Here is the output for python 3: |
|
@lwcolton sorry for the late reply! If I remember correctly it is not Packetizer <-> Transport that has a circular reference but Channel <-> Transport. A transport can have multiple channels (self._channels is an instance of ChannelMap that keeps a reference to a channel and its id for the current transport). A channel is also created from the transport in question and then the transport is injected into the channel (see the _set_transport method and call). Something like this, graphwise: There is also a prior pull request that I wanted to investigate more that fixes a reference cycle in Trasport/Channel: #367 but i would prefer a solution without the need for a weakref. |
Fix issue #440.
SSHClient did not need to worry about closing transport, as there is no cyclic reference. Transport can be responsible for closing itself when it's reference count is 0. The following code verifies that Transport.close() is called properly.
Output:
$ python test3p.py
close called