Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socketserver.shutdown should stop serve_forever() immediately #88932

Open
encukou opened this issue Jul 28, 2021 · 2 comments
Open

socketserver.shutdown should stop serve_forever() immediately #88932

encukou opened this issue Jul 28, 2021 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@encukou
Copy link
Member

encukou commented Jul 28, 2021

BPO 44769
Nosy @encukou

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-07-28.21:32:39.337>
labels = ['library']
title = 'socketserver.shutdown should stop serve_forever()  immediately'
updated_at = <Date 2021-07-29.07:21:46.545>
user = 'https://github.com/encukou'

bugs.python.org fields:

activity = <Date 2021-07-29.07:21:46.545>
actor = 'petr.viktorin'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-07-28.21:32:39.337>
creator = 'petr.viktorin'
dependencies = []
files = []
hgrepos = []
issue_num = 44769
keywords = []
message_count = 2.0
messages = ['398427', '398462']
nosy_count = 1.0
nosy_names = ['petr.viktorin']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue44769'
versions = []

@encukou
Copy link
Member Author

encukou commented Jul 28, 2021

Currently, socketserver.serve_forever() sets a variable and serve_forever() polls for it, with a configurable interval.

A comment in the code already says:
# XXX: Consider using another file descriptor or connecting to the
# socket to wake this up instead of polling. Polling reduces our
# responsiveness to a shutdown request and wastes cpu at all other
# times.

@encukou encukou added stdlib Python modules in the Lib dir labels Jul 28, 2021
@encukou
Copy link
Member Author

encukou commented Jul 29, 2021

This isn't a high priority for me, but I have a WIP branch in https://github.com/encukou/cpython/tree/http-server-poll
Feel free to continue it if you get to it sooner than I do.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant