Gossip service implementation for cluster node autodiscovery with failure detection

This commit is contained in:
mdecimus
2024-05-10 20:34:08 +02:00
parent cf6765b70d
commit f4e5a0baf5
24 changed files with 1257 additions and 56 deletions

View File

@@ -307,7 +307,7 @@ async fn init_imap_tests(store_id: &str, delete_if_exists: bool) -> IMAPTest {
config.assert_no_errors();
// Spawn servers
let shutdown_tx = servers.spawn(|server, acceptor, shutdown_rx| {
let (shutdown_tx, _) = servers.spawn(|server, acceptor, shutdown_rx| {
match &server.protocol {
ServerProtocol::Smtp | ServerProtocol::Lmtp => server.spawn(
SmtpSessionManager::new(smtp.clone()),

View File

@@ -451,7 +451,7 @@ async fn init_jmap_tests(store_id: &str, delete_if_exists: bool) -> JMAPTest {
config.assert_no_errors();
// Spawn servers
let shutdown_tx = servers.spawn(|server, acceptor, shutdown_rx| {
let (shutdown_tx, _) = servers.spawn(|server, acceptor, shutdown_rx| {
match &server.protocol {
ServerProtocol::Smtp | ServerProtocol::Lmtp => server.spawn(
SmtpSessionManager::new(smtp.clone()),

View File

@@ -159,25 +159,27 @@ impl TestServer {
let jmap_manager = JmapSessionManager::new(jmap);
config.assert_no_errors();
servers.spawn(|server, acceptor, shutdown_rx| {
match &server.protocol {
ServerProtocol::Smtp | ServerProtocol::Lmtp => server.spawn(
smtp_manager.clone(),
instance.core.clone(),
acceptor,
shutdown_rx,
),
ServerProtocol::Http => server.spawn(
jmap_manager.clone(),
instance.core.clone(),
acceptor,
shutdown_rx,
),
ServerProtocol::Imap | ServerProtocol::ManageSieve => {
unreachable!()
}
};
})
servers
.spawn(|server, acceptor, shutdown_rx| {
match &server.protocol {
ServerProtocol::Smtp | ServerProtocol::Lmtp => server.spawn(
smtp_manager.clone(),
instance.core.clone(),
acceptor,
shutdown_rx,
),
ServerProtocol::Http => server.spawn(
jmap_manager.clone(),
instance.core.clone(),
acceptor,
shutdown_rx,
),
ServerProtocol::Imap | ServerProtocol::ManageSieve => {
unreachable!()
}
};
})
.0
}
pub fn new_session(&self) -> Session<DummyIo> {