Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(metrics): replace hyper server implementation with axum #16145

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Apr 4, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

hyper::Server is removed in hyper v1 because it has problems.
We'd better switch to axum for high-level HTTP server.

Also remove hyper v1 dep in meta/dashboard because it's only used for re-exporting interfaces from http v1, which is re-exported by axum v0.7 as well.

Verified the functionality locally.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@BugenZhao BugenZhao requested a review from a team as a code owner April 4, 2024 09:29
@BugenZhao BugenZhao changed the title refactor(metrics): replace hyper implementation with axum refactor(metrics): replace hyper server implementation with axum Apr 4, 2024
Copy link
Member Author

Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubber stamp

@MrCroxx
Copy link
Contributor

MrCroxx commented Apr 5, 2024

error[E0308]: mismatched types
  --> src/common/common_service/src/metrics_manager.rs:48:37
   |
48 |                         axum::serve(TcpListener::bind(&listen_addr).await.unwrap(), service);
   |                         ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `TcpListener`, found `madsim_tokio::net::TcpListener`
   |                         |
   |                         arguments to this function are incorrect
   |
   = note: `madsim_tokio::net::TcpListener` and `TcpListener` have similar names, but are actually distinct types
note: `madsim_tokio::net::TcpListener` is defined in crate `madsim`
  --> /risingwave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/madsim-0.2.22/src/sim/net/tcp/listener.rs:8:1
   |
8  | pub struct TcpListener {
   | ^^^^^^^^^^^^^^^^^^^^^^
note: `TcpListener` is defined in crate `tokio`
  --> /risingwave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/net/tcp/listener.rs:54:5
   |
54 |     pub struct TcpListener {
   |     ^^^^^^^^^^^^^^^^^^^^^^
note: function defined here
  --> /risingwave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/axum-0.7.4/src/serve.rs:96:8
   |
96 | pub fn serve<M, S>(tcp_listener: TcpListener, make_service: M) -> Serve<M, S>
   |        ^^^^^
For more information about this error, try `rustc --explain E0308`.
error: could not compile `risingwave_common_service` (lib) due to 1 previous error

cc @wangrunji0408

@BugenZhao BugenZhao enabled auto-merge April 9, 2024 06:04
@BugenZhao BugenZhao added this pull request to the merge queue Apr 9, 2024
Merged via the queue into main with commit 3f50c60 Apr 9, 2024
29 of 31 checks passed
@BugenZhao BugenZhao deleted the bz/less-hyper-1 branch April 9, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants