Skip to content

Commit 29bbb6f

Browse files
committed
Merge remote-tracking branch 'upstream/storage-service-dev' into merge-main
2 parents a069c77 + 2cbdff6 commit 29bbb6f

8 files changed

Lines changed: 654 additions & 162 deletions

File tree

Cargo.lock

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/spider-storage/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ tokio = {
3030
version = "1.50.0",
3131
features = ["macros", "rt-multi-thread", "sync", "time"]
3232
}
33+
tokio-util = { version = "0.7.18", features = ["rt"] }
3334
tracing = { version = "0.1.44", features = ["attributes"] }
35+
uuid = { version = "1.19.0", features = ["serde"] }
3436

3537
[dev-dependencies]
3638
anyhow = "1.0.98"
3739
rand = "0.9.1"
3840
serial_test = { version = "3.2.0", features = ["file_locks"] }
3941
tabled = "0.20.0"
4042
tokio = { version = "1.50.0", features = ["macros", "rt-multi-thread", "sync"] }
41-
tokio-util = { version = "0.7", features = ["rt"] }
43+
uuid = { version = "1.19.0", features = ["v4"] }

components/spider-storage/src/cache/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,17 @@ pub enum InternalError {
7878
#[error("invalid config: {0}")]
7979
ReadyQueueInvalidConfig(&'static str),
8080

81+
#[error("invalid config: {0}")]
82+
TaskInstancePoolInvalidConfig(&'static str),
83+
8184
#[error("ready queue channel is closed")]
8285
ReadyQueueChannelClosed,
8386

8487
#[error(transparent)]
8588
WireError(#[from] WireError),
89+
90+
#[error(transparent)]
91+
Db(#[from] crate::db::DbError),
8692
}
8793

8894
/// Enums for all errors representing operations that are rejected due to stale cache state.

components/spider-storage/src/ready_queue.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl ReadyQueueReceiverHandle {
296296
///
297297
/// * Forwards [`ReadyQueueConfig::validate`]'s return values on failure.
298298
pub fn create_ready_queue(
299-
config: ReadyQueueConfig,
299+
config: &ReadyQueueConfig,
300300
) -> Result<(ReadyQueueSenderHandle, ReadyQueueReceiverHandle), InternalError> {
301301
config.validate()?;
302302

@@ -379,7 +379,7 @@ mod tests {
379379

380380
#[tokio::test(flavor = "multi_thread")]
381381
async fn recv_returns_early_when_max_items_reached() -> anyhow::Result<()> {
382-
let (sender, receiver) = create_ready_queue(ReadyQueueConfig {
382+
let (sender, receiver) = create_ready_queue(&ReadyQueueConfig {
383383
task_capacity: 1,
384384
commit_capacity: 1,
385385
cleanup_capacity: 1,
@@ -425,7 +425,7 @@ mod tests {
425425

426426
#[tokio::test(flavor = "multi_thread")]
427427
async fn recv_returns_empty_when_wait_elapses() -> anyhow::Result<()> {
428-
let (_sender, receiver) = create_ready_queue(ReadyQueueConfig {
428+
let (_sender, receiver) = create_ready_queue(&ReadyQueueConfig {
429429
task_capacity: 1,
430430
commit_capacity: 1,
431431
cleanup_capacity: 1,

components/spider-storage/src/state.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
pub mod error;
22
pub mod job_cache;
3+
pub mod runtime;
34
pub mod service;
45

56
pub use error::StorageServerError;
67
pub use job_cache::JobCache;
8+
pub use runtime::{Runtime, create_runtime};
79
pub use service::ServiceState;
810

911
#[cfg(test)]

0 commit comments

Comments
 (0)