router icon indicating copy to clipboard operation
router copied to clipboard

hyper 1.0 update

Open Geal opened this issue 2 years ago • 2 comments

The new version of hyper is coming soon (we are already at 1.0.0-rc.4), so we should plan around it. Right now I have no idea about the impact or size of this task so I'll explore a bit. One thing that is known already, is that the connection pool was removed, which should help for https://github.com/apollographql/router/issues/2063, but requires that we integrate a new connection pool.

TODO:

  • [ ] test the update to hyper 1.0.0-rc.4

Geal avatar Sep 06 '23 14:09 Geal

We will also have to upgrade axum and tower-http. Both are, for now, not already migrated to the new hyper

bnjjj avatar Nov 27 '23 09:11 bnjjj

Some details about this upgrade:

  • the HTTP client we used has moved to the hyper-util crate. To make the upgrade smoother, we can start using that crate, then in a follow up check if we want to keep it
  • hyper::Body does not exist anymore, there's now a Body trait that all body types must implement
  • there are some Body implementations in the hyper-body-util crate, but none with the same API as the old Body type
  • before attempting the upgrade, we should probably make our own HTTP body type, to use in RouterService and HttpClientService, and replace all uses of hyper::Body with it. Then we will be able to upgrade the hyper body in one place

Geal avatar Jan 31 '24 14:01 Geal