Skip to content

PostgresJsonResponse: disconnect watcher can call reschedule() on a finished asyncio.Timeout #59

Description

@aersam

Seen once under Granian when the query failed before the first byte: Task exception was never retrieved: RuntimeError('Cannot change state of finished Timeout') from cancel_scope.reschedule(loop.time()) in watch_for_disconnect (pgdevkit/fastapi/json_response.py). The watcher is cancelled in the finally, so this needs a window I could not reproduce deterministically; a guard (if not cancel_scope.expired() / suppress RuntimeError around reschedule) would make it harmless. Found in the review of #58. (The related 'No response returned.' with BaseHTTPMiddleware is fixed in #58.)

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions