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

asyncore's urgent data management and connection closed events are broken when using poll() #48751

Closed
giampaolo opened this issue Dec 3, 2008 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@giampaolo
Copy link
Contributor

BPO 4501
Nosy @josiahcarlson, @giampaolo, @bitdancer, @intgr
Files
  • asyncore.patch: asyncore's loop() patch (including modified tests)
  • 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 2009-04-12.17:28:32.640>
    created_at = <Date 2008-12-03.01:10:51.345>
    labels = ['type-bug', 'library']
    title = "asyncore's urgent data management and connection closed events  are broken when using poll()"
    updated_at = <Date 2009-04-12.17:28:32.633>
    user = 'https://github.com/giampaolo'

    bugs.python.org fields:

    activity = <Date 2009-04-12.17:28:32.633>
    actor = 'r.david.murray'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-04-12.17:28:32.640>
    closer = 'r.david.murray'
    components = ['Library (Lib)']
    creation = <Date 2008-12-03.01:10:51.345>
    creator = 'giampaolo.rodola'
    dependencies = []
    files = ['12206']
    hgrepos = []
    issue_num = 4501
    keywords = ['patch']
    message_count = 3.0
    messages = ['76807', '77902', '85912']
    nosy_count = 5.0
    nosy_names = ['josiahcarlson', 'giampaolo.rodola', 'josiah.carlson', 'r.david.murray', 'intgr']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue4501'
    versions = ['Python 2.6', 'Python 3.0', 'Python 3.1', 'Python 2.7']

    @giampaolo
    Copy link
    Contributor Author

    I discovered that some pyftpdlib [1] tests fail when using poll()
    instead of select().
    The problem is in asyncore.readwrite() function which erroneously calls
    handle_read_event() in case of a POLLPRI event.

    The patches modify readwrite() function so that:

    • POLLPRI is now treated as synonym for "there is urgent data to read"
      so handle_expt_event() is called.
    • POLLHUP, POLLERR and POLLINVAL are now treated as synonyms for "the
      connection has been closed" (Twisted behaves exactly the same) so
      handle_close() is called.

    Both pyftpdlib and asyncore tests passed on Linux Debian Etch and
    FreeBSD 7.0-RC1.

    [1] http://code.google.com/p/pyftpdlib/

    @giampaolo giampaolo added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Dec 3, 2008
    @giampaolo
    Copy link
    Contributor Author

    IMHO it would be good if this could go in the latest 2.4 and 2.5
    upcoming releases while we still have the chance.

    @bitdancer
    Copy link
    Member

    Fixed as part of the work done on bpo-1161031.

    @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 type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants