This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mhughes
Recipients mhughes, miss-islington, vstinner
Date 2020-07-03.16:10:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593792646.11.0.477701847411.issue37322@roundup.psfhosted.org>
In-reply-to
Content
I noticed this test was still emitting a "ResourceWarning":
----------------------------------------------------------------------
$ ./python -m test test_ssl -m TestPostHandshakeAuth 
0:00:00 load avg: 0.74 Run tests sequentially
0:00:00 load avg: 0.74 [1/1] test_ssl
/home/mjh/src/cpython/Lib/test/support/threading_helper.py:209: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 33451), raddr=('127.0.0.1', 34038)>
  del self.thread
ResourceWarning: Enable tracemalloc to get the object allocation traceback

== Tests result: SUCCESS ==

1 test OK.

Total duration: 1.1 sec
Tests result: SUCCESS
----------------------------------------------------------------------
and thought I would try silencing it by ensuring the SSL connection handled by the separate thread was closed before exiting. My attempt involved checking the thread's exception and acting accordingly, but I ran into a race condition which (solely as a proof of concept) I resolved by adding a sleep() call (see patch).

While I continue to search for a proper resolution I was wondering what approach someone with more insight might suggest.
History
Date User Action Args
2020-07-03 16:10:46mhughessetrecipients: + mhughes, vstinner, miss-islington
2020-07-03 16:10:46mhughessetmessageid: <1593792646.11.0.477701847411.issue37322@roundup.psfhosted.org>
2020-07-03 16:10:46mhugheslinkissue37322 messages
2020-07-03 16:10:45mhughescreate