mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 11:32:19 +00:00
refactor(storage-api): remove namespace lock from StorageAPI (#3365)
* refactor(storage-api): remove namespace lock from StorageAPI * test(scanner): wait for runtime budget cancellation --------- Co-authored-by: loverustfs <hello@rustfs.com>
This commit is contained in:
@@ -37,7 +37,6 @@ use rustfs_config::{
|
||||
ENV_SCANNER_CYCLE_MAX_OBJECTS,
|
||||
};
|
||||
use rustfs_config::{ENV_SCANNER_CYCLE, ENV_SCANNER_SPEED, ENV_SCANNER_START_DELAY_SECS};
|
||||
use rustfs_ecstore::StorageAPI as _;
|
||||
use rustfs_ecstore::bucket::lifecycle::lifecycle::Lifecycle as _;
|
||||
use rustfs_ecstore::bucket::metadata_sys::{get_lifecycle_config, get_replication_config};
|
||||
use rustfs_ecstore::bucket::replication::ReplicationConfigurationExt as _;
|
||||
@@ -46,7 +45,7 @@ use rustfs_ecstore::disk::RUSTFS_META_BUCKET;
|
||||
use rustfs_ecstore::error::Error as EcstoreError;
|
||||
use rustfs_ecstore::global::is_erasure_sd;
|
||||
use rustfs_ecstore::store::ECStore;
|
||||
use rustfs_ecstore::store_api::BucketOperations;
|
||||
use rustfs_ecstore::store_api::{BucketOperations, NamespaceLocking as _};
|
||||
use rustfs_storage_api::BucketOptions;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
@@ -184,11 +184,14 @@ mod tests {
|
||||
},
|
||||
);
|
||||
|
||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
||||
let token = budget.token();
|
||||
tokio::time::timeout(Duration::from_secs(1), token.cancelled())
|
||||
.await
|
||||
.expect("runtime budget did not cancel child token");
|
||||
|
||||
assert!(budget.budget_elapsed());
|
||||
assert_eq!(budget.reason(), Some(ScannerCycleBudgetReason::Runtime));
|
||||
assert!(budget.token().is_cancelled());
|
||||
assert!(token.is_cancelled());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user