Upstream commit: 9d1c75ab68435e4417337f768291e5f947686203 Enterprise-only files removed or emptied: 63 Enterprise-only snippets removed: 118 in 50 files Dangling module declarations removed: 5 Edits turning enterprise off: 25 Third-party code: 14 files, 0 not in THIRD-PARTY.md Verification: clean One snippet more than v0.16.22, in crates/common/src/auth/authentication.rs (3, was 2).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "services"
|
||||
version = "0.16.22"
|
||||
version = "0.16.23"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -94,6 +94,13 @@ pub fn spawn_broadcast_subscriber(inner: Arc<Inner>, mut shutdown_rx: watch::Rec
|
||||
}
|
||||
};
|
||||
|
||||
inner
|
||||
.shared_core
|
||||
.load()
|
||||
.storage
|
||||
.data
|
||||
.invalidate_read_snapshot();
|
||||
|
||||
loop {
|
||||
match batch.next_event() {
|
||||
Ok(Some(event)) => {
|
||||
@@ -155,9 +162,7 @@ pub fn spawn_broadcast_subscriber(inner: Arc<Inner>, mut shutdown_rx: watch::Rec
|
||||
.await;
|
||||
}
|
||||
BroadcastEvent::QueueRefresh => {
|
||||
let core = inner.shared_core.load_full();
|
||||
if core.network.roles.outbound_mta {
|
||||
core.storage.data.invalidate_read_snapshot();
|
||||
if inner.shared_core.load().network.roles.outbound_mta {
|
||||
let _ = inner
|
||||
.ipc
|
||||
.queue_tx
|
||||
@@ -166,9 +171,7 @@ pub fn spawn_broadcast_subscriber(inner: Arc<Inner>, mut shutdown_rx: watch::Rec
|
||||
}
|
||||
}
|
||||
BroadcastEvent::RegistryChange(change) => {
|
||||
let server = inner.build_server();
|
||||
server.store().invalidate_read_snapshot();
|
||||
match Box::pin(server.reload_registry(change)).await {
|
||||
match Box::pin(inner.build_server().reload_registry(change)).await {
|
||||
Ok(result) => {
|
||||
result.log();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
use crate::task_manager::TaskResult;
|
||||
use crate::task_manager::{TaskResult, deferred_retry_time};
|
||||
use common::Server;
|
||||
use email::{message::metadata::MessageMetadata, sieve::SieveScript};
|
||||
use groupware::file::FileNode;
|
||||
@@ -39,7 +39,7 @@ impl DestroyAccountTask for Server {
|
||||
match destroy_account(self, task).await {
|
||||
Ok(result) => result,
|
||||
Err(err) => {
|
||||
let result = TaskResult::temporary(err.to_string());
|
||||
let result = TaskResult::deferred(deferred_retry_time(&err), err.to_string());
|
||||
trc::error!(
|
||||
err.account_id(task.account_id.document_id())
|
||||
.details("Failed to destroy account")
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
use crate::task_manager::{Task, TaskDetails, TaskFailureType, TaskResult};
|
||||
use crate::task_manager::{Task, TaskDetails, TaskFailureType, TaskResult, deferred_retry_time};
|
||||
use common::Server;
|
||||
use email::{cache::MessageCacheFetch, message::metadata::MessageMetadata};
|
||||
use groupware::{cache::GroupwareCache, calendar::CalendarEvent, contact::ContactCard};
|
||||
@@ -255,7 +255,7 @@ impl SearchIndexTask for Server {
|
||||
);
|
||||
for r in results.iter_mut() {
|
||||
if r.task_type == TaskType::Insert && r.result.is_success() {
|
||||
r.result = search_store_failure(retry_at, "Failed to index documents");
|
||||
r.result = TaskResult::deferred(retry_at, "Failed to index documents");
|
||||
}
|
||||
}
|
||||
return results;
|
||||
@@ -312,7 +312,7 @@ impl SearchIndexTask for Server {
|
||||
for r in results.iter_mut() {
|
||||
if r.task_type == TaskType::Delete && r.result.is_success() {
|
||||
r.result =
|
||||
search_store_failure(retry_at, "Failed to delete documents from index");
|
||||
TaskResult::deferred(retry_at, "Failed to delete documents from index");
|
||||
}
|
||||
}
|
||||
return results;
|
||||
@@ -426,22 +426,6 @@ pub(crate) async fn reindex_account(server: &Server, account_id: u32) -> trc::Re
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn deferred_retry_time(err: &trc::Error) -> Option<u64> {
|
||||
err.value(trc::Key::NextRetry)
|
||||
.and_then(|value| value.to_uint())
|
||||
}
|
||||
|
||||
fn search_store_failure(retry_at: Option<u64>, message: &'static str) -> TaskResult {
|
||||
match retry_at {
|
||||
Some(retry_at) => TaskResult::Failure {
|
||||
typ: TaskFailureType::Retry(retry_at),
|
||||
message: message.into(),
|
||||
max_attempts: None,
|
||||
},
|
||||
None => TaskResult::temporary(message),
|
||||
}
|
||||
}
|
||||
|
||||
fn attempt_number(status: &TaskStatus) -> u64 {
|
||||
match status {
|
||||
TaskStatus::Pending(_) => 0,
|
||||
|
||||
@@ -621,6 +621,7 @@ pub fn perpetual_retry_time(typ: TaskType, attempt: u64) -> Option<u64> {
|
||||
| TaskType::DkimManagement
|
||||
| TaskType::IndexDocument
|
||||
| TaskType::UnindexDocument
|
||||
| TaskType::DestroyAccount
|
||||
)
|
||||
.then(|| {
|
||||
now().saturating_add(
|
||||
|
||||
@@ -134,4 +134,20 @@ impl TaskResult {
|
||||
max_attempts: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn deferred(retry_at: Option<u64>, message: impl Into<String>) -> Self {
|
||||
match retry_at {
|
||||
Some(retry_at) => TaskResult::Failure {
|
||||
typ: TaskFailureType::Retry(retry_at),
|
||||
message: message.into(),
|
||||
max_attempts: None,
|
||||
},
|
||||
None => TaskResult::temporary(message),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn deferred_retry_time(err: &trc::Error) -> Option<u64> {
|
||||
err.value(trc::Key::NextRetry)
|
||||
.and_then(|value| value.to_uint())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user