Skip to content

HTTPServer can't deal with persistent connection properly #76699

Closed

Description

@linuxholic
mannequin
BPO 32518
Nosy @bitdancer, @vadmium, @linuxholic
PRs
  • bpo-32518: hang in persistent connection #5135
  • Superseder
  • bpo-31639: http.server and SimpleHTTPServer hang after a few requests
  • 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 2018-01-08.12:59:32.237>
    created_at = <Date 2018-01-08.08:09:03.175>
    labels = ['type-bug', 'library']
    title = "HTTPServer can't deal with persistent connection properly"
    updated_at = <Date 2018-01-09.13:36:07.744>
    user = 'https://github.com/linuxholic'

    bugs.python.org fields:

    activity = <Date 2018-01-09.13:36:07.744>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-01-08.12:59:32.237>
    closer = 'r.david.murray'
    components = ['Library (Lib)']
    creation = <Date 2018-01-08.08:09:03.175>
    creator = '\xe6\x9d\xa8\xe9\xb9\x8f'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32518
    keywords = []
    message_count = 6.0
    messages = ['309659', '309660', '309664', '309683', '309696', '309697']
    nosy_count = 3.0
    nosy_names = ['r.david.murray', 'martin.panter', '\xe6\x9d\xa8\xe9\xb9\x8f']
    pr_nums = ['5135']
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '31639'
    type = 'behavior'
    url = 'https://bugs.python.org/issue32518'
    versions = ['Python 2.7']

    Activity

    1. linuxholic commented on Jan 8, 2018

      linuxholicmannequin
      MannequinAuthor

      when client is using persistent connection, HTTPServer will hang with that connection. As a result, it can't deal with other clients.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Jan 8, 2018
    3. vadmium commented on Jan 8, 2018

      @vadmium
      Member

      Perhaps this can be treated as a duplicate of bpo-31639.

    4. bitdancer commented on Jan 8, 2018

      @bitdancer
      Member

      Yes, I would say it is.

      Note that this isn't going to get "fixed" in 2.7, because 2.7 doesn't get new features, and the proposed change to the CLI is a new feature. As noted in that issue discussion we aren't going to change the inheritance hierarchy of the classes. It is up to the library user to make that choice and implement it.

    5. linuxholic commented on Jan 9, 2018

      linuxholicmannequin
      MannequinAuthor

      OK,i got it. thanks for your reply. But i have to say, the BaseHTTPServer document is kind of confusing. It claims to support persistent connection, but actually it hangs with such situation, i can't even shut it down with shudown() method. After diving into source code of SocketServer, i finally found the myth.

    6. bitdancer commented on Jan 9, 2018

      @bitdancer
      Member

      Well, it does support a persistent connection, but that connection lasts until it is shut down from the other side. Documentation improvement suggestions are welcome.

    7. bitdancer commented on Jan 9, 2018

      @bitdancer
      Member

      In particular, if we don't already have an example of using the threading mixin we should, so a doc RFE to add that would be nice.

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions