move top bid handling to a separate tile#423
Conversation
|
|
||
| use super::*; | ||
|
|
||
| // #[test] |
There was a problem hiding this comment.
maybe we should delete this?
There was a problem hiding this comment.
yes - it is deleted
| attach_tile( | ||
| TopBidTile::new(web_socket_recv), | ||
| spine, | ||
| TileConfig::new(config.cores.top_bid, flux::utils::ThreadPriority::High), | ||
| ); |
There was a problem hiding this comment.
🟡 WebSocket receiver dropped on non-submission instances causes silent connection failures
On non-submission instances (config.is_submission_instance == false), the TopBidTile is never created (it's only attached inside the if config.is_submission_instance block at crates/relay/src/main.rs:195-235), so web_socket_recv is dropped when the closure exits at crates/relay/src/main.rs:275. However, web_socket_send is always passed to start_api_service at crates/relay/src/main.rs:179, and the GetTopBid route is always registered in the router (crates/relay/src/api/router.rs:64). When a client connects to /top_bid on a non-submission instance, the HTTP 101 upgrade response succeeds, the async task creates the RawWebSocket, but sender.try_send(socket) (crates/relay/src/api/builder/top_bid.rs:43) immediately fails with TrySendError::Disconnected because the receiver was dropped, and the WebSocket is silently closed. This is a behavioral regression: the old broadcast-based approach kept WebSocket connections alive with pings on non-submission instances.
Prompt for agents
In crates/relay/src/main.rs, the TopBidTile (lines 231-235) is only attached inside the `if config.is_submission_instance` block, but web_socket_send is always passed to start_api_service (line 179). On non-submission instances, web_socket_recv is dropped when the closure exits, causing all try_send calls on web_socket_send to fail immediately.
Two possible fixes:
1. Move the TopBidTile attachment outside the `if config.is_submission_instance` block so it always runs, keeping WebSocket connections alive even on non-submission instances.
2. Only create the channel and pass web_socket_send to start_api_service when is_submission_instance is true, and disable/reject the GetTopBid route on non-submission instances to give clients a clear error instead of a broken WebSocket upgrade.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
@0w3n-d is this a concern? I thought top bid would only be active on submission instance?
Uh oh!
There was an error while loading. Please reload this page.