Skip to content

chore: enable http/1.1 for rust mvtx daemon server#3180

Draft
KeranYang wants to merge 34 commits intomainfrom
httpsever
Draft

chore: enable http/1.1 for rust mvtx daemon server#3180
KeranYang wants to merge 34 commits intomainfrom
httpsever

Conversation

@KeranYang
Copy link
Member

@KeranYang KeranYang commented Feb 2, 2026

What this PR does / why we need it

Rust MonoVertex server can now serve both gRPC and HTTP requests.

Testing

Tested by running rust daemon server and successfully verified the /readyz and /livez endpoints (backed by HTTP/1.1) worked.

Special notes for reviewers

It continues to be dead code, meaning merging this PR won't affect the existing daemon server backed by GoLang.

.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
@KeranYang KeranYang changed the title chore: enable HTTP for rust mvtx daemon server (WIP) chore: enable HTTP for rust mvtx daemon server Feb 2, 2026
@KeranYang KeranYang changed the title (WIP) chore: enable HTTP for rust mvtx daemon server (WIP) chore: enable http/1.1 for rust mvtx daemon server Feb 2, 2026
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 82.40535% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.34%. Comparing base (a21b12d) to head (7ccc22b).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
rust/numaflow-daemon/src/lib.rs 0.00% 52 Missing ⚠️
rust/numaflow-daemon/src/connection_acceptor.rs 88.43% 20 Missing ⚠️
rust/numaflow-daemon/src/http_server.rs 95.04% 5 Missing ⚠️
rust/numaflow-daemon/src/grpc_server.rs 97.22% 1 Missing ⚠️
rust/numaflow/src/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3180      +/-   ##
==========================================
+ Coverage   80.31%   80.34%   +0.03%     
==========================================
  Files         297      300       +3     
  Lines       67640    68028     +388     
==========================================
+ Hits        54323    54660     +337     
- Misses      12764    12818      +54     
+ Partials      553      550       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
@KeranYang KeranYang changed the title (WIP) chore: enable http/1.1 for rust mvtx daemon server chore: enable http/1.1 for rust mvtx daemon server Feb 3, 2026
@KeranYang KeranYang marked this pull request as ready for review February 3, 2026 16:15
@KeranYang
Copy link
Member Author

Is there a way to start both gRPC and HTTP together?

@whynowy to answer your question on my previous PR, yes, this PR achieves starting both gRPC and HTTP servers.

@yhl25
Copy link
Contributor

yhl25 commented Feb 3, 2026

Since this is being merged into master, can we modularize the code and ensure it’s properly unit tested? I’m fine with merging if it’s well tested and serves a specific purpose, but in its current form this feels more like a POC.

let (http_tx, mut http_rx) = mpsc::channel(1000);

// Start a thread to accept requests.
let _accept_req_task = tokio::spawn(async move {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make sure tokio tasks exit? spawned tasks are not tracked

let grpc_res = grpc_server_task.await?;
grpc_res?;

// TODO - Gracefully shutdown.
Copy link
Contributor

Choose a reason for hiding this comment

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

graceful shutdown is critical, can we tackle that before merging the PR?

// Send to the HTTP channel by default.
// This is because most of the time, HTTP is used for communication.
// On Numaflow, if a client is sending a gRPC request, the h2 protocol is explicitly used.
let _ = http_sender.send(stream).await;
Copy link
Contributor

Choose a reason for hiding this comment

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

log or handle errors?


let addr = format!("[::]:{}", DAEMON_SERVICE_PORT).parse()?;
// Create a TCP listener that can listen to both h2 and http 1.1.
let addr: SocketAddr = format!("[::]:{}", DAEMON_SERVICE_PORT).parse()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we split this more functions like start_grpc_server(),
start_http_server(), serve_requests()? to make it more readable also makes it easy to review the code.

@KeranYang
Copy link
Member Author

@yhl25 Thank you for the detailed review. I will address them as part of this PR. FYI, I am re-writing daemon in rust, one small PR at a time and till it achieves feature parity with golang, it remains dead code. See:

// DO NOT DO IT unless you are testing. Daemon server in rust is not ready yet.

@yhl25
Copy link
Contributor

yhl25 commented Feb 3, 2026

@yhl25 Thank you for the detailed review. I will address them as part of this PR. FYI, I am re-writing daemon in rust, one small PR at a time and till it achieves feature parity with golang, it remains dead code. See:

// DO NOT DO IT unless you are testing. Daemon server in rust is not ready yet.

Dead code is fine, since its being merged to master please make sure the code is production quality.

@KeranYang KeranYang marked this pull request as draft February 4, 2026 18:33
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
.
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Signed-off-by: Keran Yang <yangkr920208@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants