Skip to content

rusk: implement RuskHttp builder and shutdown#4006

Open
Neotamandua wants to merge 1 commit intomasterfrom
neotamandua/graceful_shutdown
Open

rusk: implement RuskHttp builder and shutdown#4006
Neotamandua wants to merge 1 commit intomasterfrom
neotamandua/graceful_shutdown

Conversation

@Neotamandua
Copy link
Member

Closes #2453

Fixes the panic messages in tests when running:
cargo test --release --lib http::tests -- --nocapture

@Neotamandua Neotamandua requested a review from Copilot February 5, 2026 18:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a builder pattern for RuskHttp with proper shutdown handling, addressing test panic messages. The changes restructure the HTTP server to support graceful shutdown with configurable timeouts and eliminate a redundant runtime.

Changes:

  • Added RuskHttp struct with run() and shutdown() methods to manage HTTP server lifecycle
  • Modified HttpServer to support graceful shutdown by making wait() consume handle once and adding shutdown() method
  • Removed nested tokio runtime in listening_loop that was causing shutdown issues

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
rusk/src/lib/http.rs Changed HttpServer fields to Option types and added shutdown() method; removed nested runtime from listening_loop
rusk/src/lib/builder/http_only.rs Added RuskHttp struct with lifecycle methods and enhanced builder with data source and timeout configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Neotamandua Neotamandua marked this pull request as draft February 5, 2026 18:53
@Neotamandua Neotamandua force-pushed the neotamandua/graceful_shutdown branch from e06c296 to 022b975 Compare February 5, 2026 19:04
@Neotamandua Neotamandua marked this pull request as ready for review February 9, 2026 09:15
@Neotamandua Neotamandua force-pushed the neotamandua/graceful_shutdown branch from 022b975 to b4efde3 Compare February 9, 2026 09:57
@Neotamandua Neotamandua force-pushed the neotamandua/graceful_shutdown branch from b4efde3 to 0a16c5c Compare February 9, 2026 10:12
Copy link
Member

@HDauven HDauven left a comment

Choose a reason for hiding this comment

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

I would approve this PR, but the removal of the dedicated HTTP runtime in listening_loop slightly concerns me.

HTTP connections now share the main runtime via task::spawn, resulting in heavy HTTP/RUES traffic potentially starving consensus. We should keep separate runtimes for chain mode or add concurrency limiting in my opinion. Consensus/core chain should always have priority over anything else.

What do you think @herr-seppia?

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.

Enhance RuskHttpBuilder with Flexible Configuration and Graceful Shutdown

2 participants