uhd-urz / elAPI

An extensible API client for eLabFTW
GNU Affero General Public License v3.0
5 stars 0 forks source link

Enabling Http/2 causes RemoteProtocolError('<ConnectionTerminated>') #46

Closed alexander-haller closed 1 month ago

alexander-haller commented 1 month ago

In GitLab by @mhxion on Jun 13, 2024, 23:30

Apparently, this is a known issue.

  1. https://github.com/encode/httpx/discussions/2112
  2. https://github.com/encode/httpcore/pull/679
  3. https://github.com/encode/httpcore/pull/679

elapi bill-teams teams-info targeted at dev-002 throw RemoteProtocolError('<ConnectionTerminated error_code:0, last_stream_id:1999, additional_data:None>') in the middle of progress. Existing reports linked above suggests making repeated HTTP/2 requests asynchronously seem to trigger this. So far, no one has any verified idea about why this is happening.

elAPI doesn't throw this error when we run elapi bill-teams teams-info targeting our production server. This compliments the other reports that this error seems to occurs when one is making a lot of requests in a short time (like elAPI does for dev-002.)

We have two options to solve this:

  1. We disable HTTP/2 (revert back the recent change)
  2. We introduce a new field enable_http2 for elapi.yml. We keep the default value False. This would mainly be for the public; if someone wants to use HTTP/2.
alexander-haller commented 1 month ago

If HTTP/2 does not introduce too much maintenance/additional code paths that need to be carried in the future we can keep it as feature for others. Internally I would keep enable_http2=False it for the time being if this is not stable.