Skip to content

ASGI spec: Connections, exceptions, and task management. #47

@lovelydinosaur

Description

@lovelydinosaur

Some questions that may or may not necessarily need be part of the ASGI (http) spec, but that might need implementor guidelines...

Trying to be fairly complete here in thinking about potential edge cases around uvicorn's handling:

  • Should an ASGI server be responsible for detecting & handling applications that raise an exception?
  • Should an ASGI server be responsible for detecting & handling applications that complete without sending a response?
  • Should an ASGI server be responsible for handling applications that do not complete, after sending a response? (Within some given timeframe.)
  • Should an ASGI server be responsible for timing out slow-returning responses?
  • How should an ASGI server be expected to act if an application raises an exception once a response is partially sent?
  • How should an ASGI server be expected to act if an application raises an exception once a response is completely sent?
  • Should an ASGI application wrap and handle exceptions themselves as 500 errors, or just propagate them to the server?
  • Should an ASGI application wrap and handle exceptions that occur once a response is partially sent, and if so how should it communicate it to the server?
  • Should an ASGI application wrap and handle exceptions that occur once a response is already fully sent, and if so how should it communicate it to the server?
  • How should send be expected to behave in the event of a closed or closing connection?
  • How should receive be expected to behave in the event of a closed or closing connection?
  • Should a connection becoming closed cancel any outstanding applications, or allow them to run to completion?

Not sure which of these do or don't need to be explicit, but think it's worth at least opening this up for discussion here.

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