Skip to content

XHR: aiohttp calls must support HTTP Keep-Alive #339

Closed

Description

@philippedistributive

Issue type

Bug

How did you install PythonMonkey?

None

OS platform and distribution

No response

Python version (python --version)

No response

PythonMonkey version (pip show pythonmonkey)

No response

Bug Description

The current XHR aiohttp code does not use keep-alive https://docs.aiohttp.org/en/stable/client_reference.html#basic-api

This will be a major product deficiency when potential integrators evaluate our product and will be a definite blocker, hence we need to support it now.

This means we should re-code the aiohttp-based XHR to use the ClientSession pattern instead.

@wes
for the connectivity exchanges we see responses with:
xhr:response response headers ----
access-control-allow-origin: *
cache-control: no-store
connection: keep-alive
content-encoding: gzip
content-type: text/plain; charset=UTF-8
date: Mon, 06 May 2024 17:15:32 GMT
server: nginx/1.18.0 (Ubuntu)
transfer-encoding: chunked
Can you confirm we don't expect the socketio transport layer to support keep-alive at that level (for example HTTP)? We only use our own keep-alive as part of DCP, at the higher-level layer?

@philippe Laporte
we should definitely be using HTTP keepalive and not second-guessing SocketIO there. Particularly with the JSONP-style transport, HTTP keepalive is a significant and important optimization (that has been standard for decades). Without it, you have to setup and tear down a TCP socket for every request.

Standalone code to reproduce the issue

No response

Relevant log output or backtrace

No response

Additional info if applicable

No response

What branch of PythonMonkey were you developing on? (If applicable)

No response

Activity

  1. added this to the v1.0.0 milestone on May 7, 2024
  2. moved this from Backlog to Ready To Do in PythonMonkey Kanban Boardon May 7, 2024
  3. added
    bugSomething isn't working
    and removed
    enhancementNew feature or request
    on May 7, 2024
  4. changed the title [-]aioHTTP calls must support HTTP Keep-Alive[/-] [+]aiohttp calls must support HTTP Keep-Alive[/+] on May 7, 2024
  5. philippedistributive commented on May 8, 2024

    @philippedistributive
    ContributorAuthor

    Possible Hint from @wesgarland:
    https://docs.aiohttp.org/en/stable/client_reference.html
    I think all we need to do is to switch to a connection pool

  6. moved this from Ready To Do to In progress in PythonMonkey Kanban Boardon May 8, 2024
  7. philippedistributive commented on May 15, 2024

    @philippedistributive
    ContributorAuthor
  8. changed the title [-]aiohttp calls must support HTTP Keep-Alive[/-] [+]XHR: aiohttp calls must support HTTP Keep-Alive[/+] on May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions