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

Expose TCP_CONGESTION and TCP_USER_TIMEOUT to the socket module #70461

Closed
osandov mannequin opened this issue Feb 3, 2016 · 16 comments
Closed

Expose TCP_CONGESTION and TCP_USER_TIMEOUT to the socket module #70461

osandov mannequin opened this issue Feb 3, 2016 · 16 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@osandov
Copy link
Mannequin

osandov mannequin commented Feb 3, 2016

BPO 26273
Nosy @pitrou, @vstinner, @ned-deily, @vadmium, @serhiy-storchaka, @1st1, @osandov, @JelteF
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • socket_tcp_options.patch
  • socket_doc.patch
  • 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 = <Date 2017-01-23.11:31:12.311>
    created_at = <Date 2016-02-03.08:54:44.439>
    labels = ['3.7', 'type-feature', 'library']
    title = 'Expose TCP_CONGESTION and TCP_USER_TIMEOUT to the socket module'
    updated_at = <Date 2017-03-31.16:36:10.224>
    user = 'https://github.com/osandov'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:10.224>
    actor = 'dstufft'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-01-23.11:31:12.311>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2016-02-03.08:54:44.439>
    creator = 'osandov'
    dependencies = []
    files = ['41787', '45692']
    hgrepos = []
    issue_num = 26273
    keywords = ['patch']
    message_count = 16.0
    messages = ['259460', '281100', '281997', '282001', '282002', '282003', '282004', '282007', '282011', '282012', '282017', '282019', '282020', '285982', '286076', '286077']
    nosy_count = 9.0
    nosy_names = ['pitrou', 'vstinner', 'ned.deily', 'python-dev', 'martin.panter', 'serhiy.storchaka', 'yselivanov', 'osandov', 'JelteF']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue26273'
    versions = ['Python 3.6', 'Python 3.7']

    @osandov
    Copy link
    Mannequin Author

    osandov mannequin commented Feb 3, 2016

    The socket module is missing a couple of TCP socket options: TCP_CONGESTION was added to Linux in v2.6.13 and TCP_USER_TIMEOUT was added in v2.6.37. These should be exposed.

    @osandov osandov mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Feb 3, 2016
    @JelteF
    Copy link
    Mannequin

    JelteF mannequin commented Nov 18, 2016

    Is there any issue in merging this? TCP_USER_TIMEOUT is quite useful, for automatic failover of connections that suddenly died.

    @pitrou
    Copy link
    Member

    pitrou commented Nov 29, 2016

    +1 for this. The patch looks fine, and there's no need to add any documentation or tests.

    @pitrou pitrou added the 3.7 (EOL) end of life label Nov 29, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 29, 2016

    New changeset 674fb9644eaa by Victor Stinner in branch 'default':
    Add TCP_CONGESTION and TCP_USER_TIMEOUT
    https://hg.python.org/cpython/rev/674fb9644eaa

    @vstinner
    Copy link
    Member

    @ned Deily: Would you be ok to add these two constants to Python 3.6? I cannot image any regression if 674fb9644eaa is backported to Python 3.6.

    @serhiy, Yury: Any opinion on the backport?

    @vstinner
    Copy link
    Member

    Sorry, I missed this issue.

    TCP_USER_TIMEOUT is super useful! It helps a lot to detect when a server is down, especially when using keep alive: at kernel level (TCP keepalive) or application level (ex: RabbitMQ heart beat).

    Linux default timeout is more something like 15 minutes. A few years ago, it was longer than 2 days :-)

    @pitrou
    Copy link
    Member

    pitrou commented Nov 29, 2016

    Le 29/11/2016 à 16:59, STINNER Victor a écrit :

    TCP_USER_TIMEOUT is super useful!

    It is :-)

    @osandov
    Copy link
    Mannequin Author

    osandov mannequin commented Nov 29, 2016

    Glad to see this finally get in :)

    @serhiy-storchaka
    Copy link
    Member

    Shouldn't we add something like versionadded/versionchanged or a mentioning in What's New?

    @1st1
    Copy link
    Member

    1st1 commented Nov 29, 2016

    Would be nice to have in 3.6.

    @ned-deily
    Copy link
    Member

    OK for 3.6.0rc1 (before it times out)

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 29, 2016

    New changeset 6d69da76be6a by Victor Stinner in branch '3.6':
    Add TCP_CONGESTION and TCP_USER_TIMEOUT
    https://hg.python.org/cpython/rev/6d69da76be6a

    @vstinner
    Copy link
    Member

    Serhiy Storchaka: "Shouldn't we add something like versionadded/versionchanged or a mentioning in What's New?"

    Oh right, we did that for other new constants added to Python 3.6 like SO_DOMAIN.

    Attached socket_doc.patch documents the additional of the two new constants. It seems like "hg transplant" putted the NEWS entry in the wrong section :-/ The patch also fixes that.

    @vadmium
    Copy link
    Member

    vadmium commented Jan 22, 2017

    Patch looks good to me.

    BTW in bpo-27409 I proposed a patch listing more of these.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jan 23, 2017

    New changeset ffb2534fcbf1 by Victor Stinner in branch '3.6':
    Issue bpo-26273: Document TCP_USER_TIMEOUT and TCP_CONGESTION
    https://hg.python.org/cpython/rev/ffb2534fcbf1

    @vstinner
    Copy link
    Member

    Patch looks good to me.

    Oh, I forgot socket_doc.patch! Thanks Serhiy for the reminder and Martin for the review :-) I just pushed the patch.

    @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
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants