Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-107

Cannot check for closed socket in asyncio

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.7
    • Affects Version/s: None
    • Component/s: asyncio
    • None

      "fileno()" for Motor's socket wrapper is not implemented for asyncio:

      https://github.com/mongodb/motor/blob/bf9c961dba0dc4a7f1b26bcb9f72014631237534/motor/frameworks/asyncio/__init__.py#L265-L265

      I believe this means a socket is always replaced when it's used after more than a second of idleness, since _closed() tries to call "select" on the Motor socket wrapper and closes it if "select" throws any exception, in this case an AssertionError.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: