classification
Title: cleanup code may fail in test_asyncio.test_unix_events.SelectorEventLoopUnixSockSendfileTests
Type: Stage: resolved
Components: asyncio, Tests Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, miss-islington, pablogsal, yselivanov
Priority: normal Keywords: patch, patch, patch

Created on 2018-12-28 04:21 by pablogsal, last changed 2018-12-29 20:14 by pablogsal. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11338 merged pablogsal, 2018-12-28 04:23
PR 11338 merged pablogsal, 2018-12-28 04:23
PR 11338 merged pablogsal, 2018-12-28 04:23
PR 11358 merged miss-islington, 2018-12-29 19:19
PR 11358 merged miss-islington, 2018-12-29 19:19
PR 11358 merged miss-islington, 2018-12-29 19:19
Messages (3)
msg332642 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-12-28 04:21
According to this buildbot:

https://buildbot.python.org/all/#/builders/170/builds/218/steps/4/logs/stdio

there is some cleanup failure in test_sock_sendfile_os_error_first_call:

test_sock_sendfile_os_error_first_call (test.test_asyncio.test_unix_events.SelectorEventLoopUnixSockSendfileTests) ... /usr/home/buildbot/python/3.7.koobs-freebsd10.nondebug/build/Lib/asyncio/selector_events.py:655: ResourceWarning: unclosed transport <_SelectorSocketTransport fd=10>
  source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
ok

The code that is supposed to clean up the resource is:

        def cleanup():
            if proto.transport is not None:
                # can be None if the task was cancelled before
                # connection_made callback
                proto.transport.close()
                self.run_loop(proto.wait_closed())

apparently, proto.transport may be None and then it fails to be closed even if the test succeeds (I assume because the condition in the comment happens or something else) and then the transport is not properly closed.
msg332729 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-12-29 19:18
New changeset d51324a2f5d172665f8824b25456c9822797fc84 by Pablo Galindo in branch 'master':
bpo-35602: Make sure the transport is always closed in SelectorEventLoopUnixSockSendfileTests (GH-11338)
https://github.com/python/cpython/commit/d51324a2f5d172665f8824b25456c9822797fc84
msg332731 - (view) Author: miss-islington (miss-islington) Date: 2018-12-29 19:38
New changeset fe06646d186780881fa5ee61442886a6d7cf9f08 by Miss Islington (bot) in branch '3.7':
bpo-35602: Make sure the transport is always closed in SelectorEventLoopUnixSockSendfileTests (GH-11338)
https://github.com/python/cpython/commit/fe06646d186780881fa5ee61442886a6d7cf9f08
History
Date User Action Args
2018-12-29 20:14:04pablogsalsetkeywords: patch, patch, patch
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-12-29 19:38:26miss-islingtonsetnosy: + miss-islington
messages: + msg332731
2018-12-29 19:19:16miss-islingtonsetpull_requests: + pull_request10675
2018-12-29 19:19:09miss-islingtonsetpull_requests: + pull_request10674
2018-12-29 19:19:02miss-islingtonsetpull_requests: + pull_request10673
2018-12-29 19:18:42pablogsalsetmessages: + msg332729
2018-12-28 04:23:48pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request10617
2018-12-28 04:23:39pablogsalsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10616
2018-12-28 04:23:31pablogsalsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10615
2018-12-28 04:21:50pablogsalcreate