classification
Title: set better defaults for TCPServer options
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, giampaolo.rodola, neologix, yselivanov
Priority: normal Keywords: easy, patch

Created on 2019-02-15 13:44 by giampaolo.rodola, last changed 2019-02-15 14:41 by giampaolo.rodola.

Pull Requests
URL Status Linked Edit
PR 11875 open giampaolo.rodola, 2019-02-15 14:41
Messages (2)
msg335612 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2019-02-15 13:44
socketserver.TCPServer provides the following defaults:

allow_reuse_address = False
request_queue_size = 5

Proposal is to:
* have "allow_reuse_address = True" on POSIX in order to immediately reuse previous sockets which were bound on the same address and remained in TIME_WAIT state
* have "request_queue_size = None" so that it's up to socket.listen() to choose a default reasonable value (usually 128)
msg335614 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2019-02-15 14:17
Update: because "request_queue_size" is passed to server_activate() method which can be subclassed, a better default for not breaking backward compatibility is 0 (not None).
History
Date User Action Args
2019-02-15 14:41:19giampaolo.rodolasetkeywords: + patch
stage: patch review
pull_requests: + pull_request11908
2019-02-15 14:17:16giampaolo.rodolasetmessages: + msg335614
2019-02-15 13:44:39giampaolo.rodolacreate