Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

asyncio.Runner+PidfdChildWatcher leaves zombie processes #95899

Closed
Assignees
kumaraditya303
Labels
3.11only security fixes3.12only security fixestopic-asynciotype-bugAn unexpected behavior, bug, or error
@kumaraditya303

Description

@kumaraditya303
importasyncioimportsysimportunittestimportasyncioasyncio.set_child_watcher(asyncio.PidfdChildWatcher())defcreate_free_port():return4# chosen by a fair dice rollclassTestProc(unittest.IsolatedAsyncioTestCase):asyncdefasyncSetUp(self):self.port=create_free_port()self.proc=awaitasyncio.create_subprocess_exec(sys.executable,"-c",# more realistically this might be an http server or databasef"import time; print('listening on{self.port}'); import time; time.sleep(2); print('goodbye')",        )asyncdeftestProc(self):print(f"connecting to{self.port}")asyncdefasyncTearDown(self):awaitself.proc.communicate()# hangs forever on 3.11if__name__=="__main__":unittest.main()

on python3.10 this produces:

connecting to 4listening on 4goodbye.----------------------------------------------------------------------Ran 1 test in 2.022sOK

on python3.11 it hangs forever inawait self.proc.communicate()

Originally posted by@graingert in#95736 (comment)

Metadata

Metadata

Labels

3.11only security fixes3.12only security fixestopic-asynciotype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp