Skip to content

Commit df3bc69

Browse files
authored
New publisher limits on bidding service config (#776)
## 📝 Summary New publisher limits on bidding service config
1 parent fd68578 commit df3bc69

File tree

1 file changed

+14
-7
lines changed
  • crates/rbuilder-operator/src/bidding_service_wrapper/fast_streams

1 file changed

+14
-7
lines changed

crates/rbuilder-operator/src/bidding_service_wrapper/fast_streams/helpers.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::{
55
};
66

77
use iceoryx2::{
8+
config::Config,
89
node::{Node, NodeBuilder, NodeCreationFailure},
910
port::{
1011
listener::{Listener, ListenerCreateError},
@@ -85,14 +86,14 @@ pub const SCRAPED_BIDS_MAX_BUFFERS: usize = 1000;
8586
const SCRAPED_MAX_LOAN_SAMPLES: usize = 100;
8687

8788
/// Should have only a single publisher.
88-
const BLOCKS_SERVICE_MAX_PUBLISHERS: usize = 5;
89+
const BLOCKS_SERVICE_MAX_PUBLISHERS: usize = 1;
8990
/// Should have only a single subscriber.
90-
const BLOCKS_SERVICE_MAX_SUBSCRIBERS: usize = 5;
91+
const BLOCKS_SERVICE_MAX_SUBSCRIBERS: usize = 1;
9192

9293
/// Should have only a single publisher.
93-
const SCRAPED_BIDS_SERVICE_MAX_PUBLISHERS: usize = 5;
94+
const SCRAPED_BIDS_SERVICE_MAX_PUBLISHERS: usize = 1;
9495
/// Should have only a single subscriber..
95-
const SCRAPED_BIDS_SERVICE_MAX_SUBSCRIBERS: usize = 5;
96+
const SCRAPED_BIDS_SERVICE_MAX_SUBSCRIBERS: usize = 1;
9697

9798
/// We only want newest item.
9899
pub const LAST_ITEM_MAX_BUFFERS: usize = 1;
@@ -101,14 +102,20 @@ pub const LAST_ITEM_MAX_LOAN_SAMPLES: usize = 2;
101102

102103
/// We create a publisher for active block. We usually can have 2 (prev and current) but with forks we could have more.
103104
/// I don't think we would ever have more than 5 but we play it safe.
104-
pub const SLOT_BIDDER_SEAL_BID_COMMAND_SERVICE_MAX_PUBLISHERS: usize = 50;
105+
pub const SLOT_BIDDER_SEAL_BID_COMMAND_SERVICE_MAX_PUBLISHERS: usize = 10;
105106
/// We should only have a single subscriber to the slot bidder seal bid command service since we spawn a single thread to poll for them.
106-
/// The other 4 are for luck...
107-
pub const SLOT_BIDDER_SEAL_BID_COMMAND_SERVICE_MAX_SUBSCRIBERS: usize = 5;
107+
pub const SLOT_BIDDER_SEAL_BID_COMMAND_SERVICE_MAX_SUBSCRIBERS: usize = 1;
108+
109+
pub const SERVICE_MAX_PUBLISHERS: usize = 10;
110+
pub const SERVICE_MAX_SUBSCRIBERS: usize = 10;
108111

109112
/// Always use this function to create a node builder to avoid issues with signal handling.
110113
pub fn create_node_builder() -> Result<Node<ipc::Service>, Error> {
114+
let mut config = Config::global_config().clone();
115+
config.defaults.publish_subscribe.max_publishers = SERVICE_MAX_PUBLISHERS;
116+
config.defaults.publish_subscribe.max_subscribers = SERVICE_MAX_SUBSCRIBERS;
111117
Ok(NodeBuilder::new()
118+
.config(&config)
112119
.signal_handling_mode(SignalHandlingMode::Disabled)
113120
.create::<ipc::Service>()?)
114121
}

0 commit comments

Comments
 (0)