Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
bce74588
Unverified
Commit
bce74588
authored
Aug 22, 2025
by
Graham King
Committed by
GitHub
Aug 22, 2025
Browse files
chore: Rust to 1.89 and edition 2024 (#2659)
parent
268d017e
Changes
199
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
69 additions
and
60 deletions
+69
-60
lib/runtime/src/storage/key_value_store/mem.rs
lib/runtime/src/storage/key_value_store/mem.rs
+1
-1
lib/runtime/src/system_status_server.rs
lib/runtime/src/system_status_server.rs
+1
-1
lib/runtime/src/transports/etcd.rs
lib/runtime/src/transports/etcd.rs
+4
-4
lib/runtime/src/transports/nats.rs
lib/runtime/src/transports/nats.rs
+2
-2
lib/runtime/src/transports/zmq.rs
lib/runtime/src/transports/zmq.rs
+2
-2
lib/runtime/src/utils/leader_worker_barrier.rs
lib/runtime/src/utils/leader_worker_barrier.rs
+2
-2
lib/runtime/src/utils/pool.rs
lib/runtime/src/utils/pool.rs
+1
-1
lib/runtime/src/utils/stream.rs
lib/runtime/src/utils/stream.rs
+1
-1
lib/runtime/src/utils/tasks/critical.rs
lib/runtime/src/utils/tasks/critical.rs
+4
-4
lib/runtime/src/utils/tasks/tracker.rs
lib/runtime/src/utils/tasks/tracker.rs
+26
-18
lib/runtime/src/utils/typed_prefix_watcher.rs
lib/runtime/src/utils/typed_prefix_watcher.rs
+1
-1
lib/runtime/src/utils/worker_monitor.rs
lib/runtime/src/utils/worker_monitor.rs
+1
-1
lib/runtime/src/worker.rs
lib/runtime/src/worker.rs
+3
-4
lib/runtime/tests/common/engines.rs
lib/runtime/tests/common/engines.rs
+1
-1
lib/runtime/tests/common/mock.rs
lib/runtime/tests/common/mock.rs
+1
-1
lib/runtime/tests/lifecycle.rs
lib/runtime/tests/lifecycle.rs
+1
-1
lib/runtime/tests/pipeline.rs
lib/runtime/tests/pipeline.rs
+11
-9
lib/runtime/tests/soak.rs
lib/runtime/tests/soak.rs
+5
-5
rust-toolchain.toml
rust-toolchain.toml
+1
-1
No files found.
lib/runtime/src/storage/key_value_store/mem.rs
View file @
bce74588
...
...
@@ -20,8 +20,8 @@ use std::sync::Arc;
use
std
::
time
::
Duration
;
use
async_trait
::
async_trait
;
use
tokio
::
sync
::
mpsc
::{
UnboundedReceiver
,
UnboundedSender
};
use
tokio
::
sync
::
Mutex
;
use
tokio
::
sync
::
mpsc
::{
UnboundedReceiver
,
UnboundedSender
};
use
super
::{
KeyValueBucket
,
KeyValueStore
,
StorageError
,
StorageOutcome
};
...
...
lib/runtime/src/system_status_server.rs
View file @
bce74588
...
...
@@ -17,7 +17,7 @@ use crate::config::HealthStatus;
use
crate
::
logging
::
make_request_span
;
use
crate
::
metrics
::
MetricsRegistry
;
use
crate
::
traits
::
DistributedRuntimeProvider
;
use
axum
::{
http
::
StatusCode
,
response
::
IntoResponse
,
routing
::
get
,
Router
};
use
axum
::{
Router
,
http
::
StatusCode
,
response
::
IntoResponse
,
routing
::
get
};
use
serde_json
::
json
;
use
std
::
sync
::{
Arc
,
OnceLock
};
use
std
::
time
::
Instant
;
...
...
lib/runtime/src/transports/etcd.rs
View file @
bce74588
...
...
@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use
crate
::{
error
,
CancellationToken
,
ErrorContext
,
Result
,
Runtime
};
use
crate
::{
CancellationToken
,
ErrorContext
,
Result
,
Runtime
,
error
};
use
async_nats
::
jetstream
::
kv
;
use
derive_builder
::
Builder
;
...
...
@@ -21,7 +21,7 @@ use derive_getters::Dissolve;
use
futures
::
StreamExt
;
use
std
::
collections
::
HashMap
;
use
std
::
sync
::
Arc
;
use
tokio
::
sync
::{
mpsc
,
RwLock
};
use
tokio
::
sync
::{
RwLock
,
mpsc
};
use
validator
::
Validate
;
use
etcd_client
::{
...
...
@@ -29,7 +29,7 @@ use etcd_client::{
TlsOptions
,
Txn
,
TxnOp
,
TxnOpResponse
,
WatchOptions
,
Watcher
,
};
pub
use
etcd_client
::{
ConnectOptions
,
KeyValue
,
LeaseClient
};
use
tokio
::
time
::{
interval
,
Duration
};
use
tokio
::
time
::{
Duration
,
interval
};
mod
lease
;
mod
path
;
...
...
@@ -605,7 +605,7 @@ impl KvCache {
#[cfg(feature
=
"integration"
)]
#[cfg(test)]
mod
tests
{
use
crate
::{
distributed
::
DistributedConfig
,
DistributedRuntime
};
use
crate
::{
DistributedRuntime
,
distributed
::
DistributedConfig
};
use
super
::
*
;
...
...
lib/runtime/src/transports/nats.rs
View file @
bce74588
...
...
@@ -28,10 +28,10 @@
//! - `NATS_AUTH_CREDENTIALS_FILE`: the path to the credentials file
//!
//! Note: `NATS_AUTH_USERNAME` and `NATS_AUTH_PASSWORD` must be used together.
use
crate
::{
metrics
::
MetricsRegistry
,
Result
};
use
crate
::{
Result
,
metrics
::
MetricsRegistry
};
use
async_nats
::
connection
::
State
;
use
async_nats
::{
client
,
jetstream
,
Subscriber
};
use
async_nats
::{
Subscriber
,
client
,
jetstream
};
use
bytes
::
Bytes
;
use
derive_builder
::
Builder
;
use
futures
::{
StreamExt
,
TryStreamExt
};
...
...
lib/runtime/src/transports/zmq.rs
View file @
bce74588
...
...
@@ -28,7 +28,7 @@
//! equivalent of a connection pool per upstream service at the cost of needing an extra internal
//! routing step per service endpoint.
use
anyhow
::{
anyhow
,
Result
};
use
anyhow
::{
Result
,
anyhow
};
use
async_zmq
::{
Context
,
Dealer
,
Router
,
Sink
,
SinkExt
,
StreamExt
};
use
bytes
::
Bytes
;
use
derive_getters
::
Dissolve
;
...
...
@@ -36,7 +36,7 @@ use futures::TryStreamExt;
use
serde
::{
Deserialize
,
Serialize
};
use
std
::{
collections
::
HashMap
,
os
::
fd
::
FromRawFd
,
sync
::
Arc
,
time
::
Duration
,
vec
::
IntoIter
};
use
tokio
::{
sync
::{
mpsc
,
Mutex
},
sync
::{
Mutex
,
mpsc
},
task
::{
JoinError
,
JoinHandle
},
};
use
tokio_util
::
sync
::
CancellationToken
;
...
...
lib/runtime/src/utils/leader_worker_barrier.rs
View file @
bce74588
...
...
@@ -14,10 +14,10 @@
// limitations under the License.
use
crate
::{
transports
::
etcd
::{
Client
,
WatchEvent
},
DistributedRuntime
,
transports
::
etcd
::{
Client
,
WatchEvent
},
};
use
serde
::{
de
::
DeserializeOwned
,
Serialize
};
use
serde
::{
Serialize
,
de
::
DeserializeOwned
};
use
std
::
collections
::{
HashMap
,
HashSet
};
use
std
::
marker
::
PhantomData
;
...
...
lib/runtime/src/utils/pool.rs
View file @
bce74588
...
...
@@ -283,7 +283,7 @@ impl<T: Returnable> Clone for Pool<T> {
#[cfg(test)]
mod
tests
{
use
super
::
*
;
use
tokio
::
time
::{
timeout
,
Duration
};
use
tokio
::
time
::{
Duration
,
timeout
};
// Implement Returnable for u32 just for testing
impl
Returnable
for
u32
{
...
...
lib/runtime/src/utils/stream.rs
View file @
bce74588
...
...
@@ -20,7 +20,7 @@ use std::{
task
::{
Context
,
Poll
},
};
use
tokio
::
time
::{
self
,
sleep_until
,
Duration
,
Instant
,
Sleep
};
use
tokio
::
time
::{
self
,
Duration
,
Instant
,
Sleep
,
sleep_until
};
pub
struct
DeadlineStream
<
S
>
{
stream
:
S
,
...
...
lib/runtime/src/utils/tasks/critical.rs
View file @
bce74588
...
...
@@ -197,14 +197,14 @@ impl CriticalTaskExecutionHandle {
/// Note: Both errors and panics trigger parent cancellation immediately via the monitor task.
pub
async
fn
join
(
mut
self
)
->
Result
<
()
>
{
self
.detached
=
true
;
let
result
=
match
self
.result_receiver
.take
()
.unwrap
()
.await
{
match
self
.result_receiver
.take
()
.unwrap
()
.await
{
Ok
(
task_result
)
=>
task_result
,
Err
(
_
)
=>
{
// This should rarely happen - means monitor task was dropped/cancelled
Err
(
anyhow
::
anyhow!
(
"Critical task monitor was cancelled"
))
}
};
result
}
}
/// Detach the task. This allows the task to continue running after the handle is dropped.
...
...
@@ -224,8 +224,8 @@ impl Drop for CriticalTaskExecutionHandle {
#[cfg(test)]
mod
tests
{
use
super
::
*
;
use
std
::
sync
::
atomic
::{
AtomicBool
,
AtomicU32
,
Ordering
};
use
std
::
sync
::
Arc
;
use
std
::
sync
::
atomic
::{
AtomicBool
,
AtomicU32
,
Ordering
};
use
std
::
time
::
Duration
;
use
tokio
::
time
::
timeout
;
...
...
lib/runtime/src/utils/tasks/tracker.rs
View file @
bce74588
...
...
@@ -380,8 +380,8 @@
use
std
::
future
::
Future
;
use
std
::
pin
::
Pin
;
use
std
::
sync
::
atomic
::{
AtomicU64
,
Ordering
};
use
std
::
sync
::
Arc
;
use
std
::
sync
::
atomic
::{
AtomicU64
,
Ordering
};
use
crate
::
metrics
::
MetricsRegistry
;
use
anyhow
::
Result
;
...
...
@@ -395,7 +395,7 @@ use tokio::sync::Semaphore;
use
tokio
::
task
::
JoinHandle
;
use
tokio_util
::
sync
::
CancellationToken
;
use
tokio_util
::
task
::
TaskTracker
as
TokioTaskTracker
;
use
tracing
::{
debug
,
error
,
warn
,
Instrument
};
use
tracing
::{
Instrument
,
debug
,
error
,
warn
};
use
uuid
::
Uuid
;
/// Error type for task execution results
...
...
@@ -4713,11 +4713,13 @@ mod tests {
// Now, trying to create a child should fail
let
result
=
parent_clone
.child_tracker
();
assert
!
(
result
.is_err
());
assert
!
(
result
.err
()
.unwrap
()
.to_string
()
.contains
(
"closed parent tracker"
));
assert
!
(
result
.err
()
.unwrap
()
.to_string
()
.contains
(
"closed parent tracker"
)
);
}
#[rstest]
...
...
@@ -4740,11 +4742,13 @@ mod tests {
// Now, trying to create a child with builder should fail
let
result
=
parent_clone
.child_tracker_builder
()
.build
();
assert
!
(
result
.is_err
());
assert
!
(
result
.err
()
.unwrap
()
.to_string
()
.contains
(
"closed parent tracker"
));
assert
!
(
result
.err
()
.unwrap
()
.to_string
()
.contains
(
"closed parent tracker"
)
);
}
#[rstest]
...
...
@@ -4909,9 +4913,11 @@ mod tests {
// Test conversion to anyhow::Error
let
anyhow_error
=
anyhow
::
Error
::
new
(
continuation_error
);
assert
!
(
anyhow_error
.to_string
()
.contains
(
"Task failed with continuation"
));
assert
!
(
anyhow_error
.to_string
()
.contains
(
"Task failed with continuation"
)
);
}
#[test]
...
...
@@ -5046,9 +5052,11 @@ mod tests {
let
anyhow_error
=
FailedWithContinuation
::
into_anyhow
(
source_error
,
restartable_task
);
assert
!
(
anyhow_error
.has_continuation
());
assert
!
(
anyhow_error
.to_string
()
.contains
(
"Task failed with continuation"
));
assert
!
(
anyhow_error
.to_string
()
.contains
(
"Task failed with continuation"
)
);
assert
!
(
anyhow_error
.to_string
()
.contains
(
"Computation failed"
));
}
...
...
lib/runtime/src/utils/typed_prefix_watcher.rs
View file @
bce74588
...
...
@@ -6,8 +6,8 @@
//! This module provides reusable patterns for watching etcd prefixes and maintaining
//! HashMap-based state that automatically updates based on etcd events.
use
crate
::
transports
::
etcd
::{
Client
as
EtcdClient
,
WatchEvent
};
use
crate
::
Result
;
use
crate
::
transports
::
etcd
::{
Client
as
EtcdClient
,
WatchEvent
};
use
etcd_client
::
KeyValue
;
use
serde
::
de
::
DeserializeOwned
;
use
std
::
collections
::
HashMap
;
...
...
lib/runtime/src/utils/worker_monitor.rs
View file @
bce74588
...
...
@@ -6,8 +6,8 @@
// different types of workers to define their own load metrics and busy thresholds.
use
crate
::
component
::{
Client
,
InstanceSource
};
use
crate
::
traits
::
events
::
EventSubscriber
;
use
crate
::
traits
::
DistributedRuntimeProvider
;
use
crate
::
traits
::
events
::
EventSubscriber
;
use
crate
::
utils
::
typed_prefix_watcher
::{
key_extractors
,
watch_prefix_with_extraction
};
use
std
::
collections
::
HashMap
;
use
std
::
sync
::{
Arc
,
RwLock
};
...
...
lib/runtime/src/worker.rs
View file @
bce74588
...
...
@@ -32,7 +32,7 @@
//! and release builds. In development, the default is [DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_DEBUG] and
//! in release, the default is [DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_RELEASE].
use
super
::{
error
,
CancellationToken
,
Result
,
Runtime
,
RuntimeConfig
};
use
super
::{
CancellationToken
,
Result
,
Runtime
,
RuntimeConfig
,
error
};
use
futures
::
Future
;
use
once_cell
::
sync
::
OnceCell
;
...
...
@@ -198,14 +198,13 @@ impl Worker {
}))))
.expect
(
"Failed to spawn application task"
);
let
task
=
INIT
INIT
.get
()
.expect
(
"Application task not initialized"
)
.lock
()
.unwrap
()
.take
()
.expect
(
"Application initialized; but another thread is awaiting it; Worker.execute() can only be called once"
);
task
.expect
(
"Application initialized; but another thread is awaiting it; Worker.execute() can only be called once"
)
}
pub
fn
from_current
()
->
Result
<
Worker
>
{
...
...
lib/runtime/tests/common/engines.rs
View file @
bce74588
...
...
@@ -27,8 +27,8 @@ use dynamo_runtime::engine::{
};
use
dynamo_runtime
::
pipeline
::{
context
::{
Context
,
StreamContext
},
Error
,
ManyOut
,
SingleIn
,
context
::{
Context
,
StreamContext
},
};
pub
type
AsyncFn
<
T
,
U
>
=
dyn
Fn
(
T
)
->
Pin
<
Box
<
dyn
Future
<
Output
=
U
>
+
Send
>>
+
Send
+
Sync
;
...
...
lib/runtime/tests/common/mock.rs
View file @
bce74588
...
...
@@ -25,8 +25,8 @@ use tokio::sync::mpsc;
use
dynamo_runtime
::
engine
::{
AsyncEngine
,
AsyncEngineContext
,
Data
,
ResponseStream
};
use
dynamo_runtime
::
pipeline
::{
context
::{
Context
,
StreamContext
},
Error
,
ManyOut
,
PipelineError
,
PipelineIO
,
SegmentSource
,
SingleIn
,
context
::{
Context
,
StreamContext
},
};
#[allow(dead_code)]
...
...
lib/runtime/tests/lifecycle.rs
View file @
bce74588
...
...
@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use
dynamo_runtime
::{
worker
::
Worker
,
Result
,
Runtime
};
use
dynamo_runtime
::{
Result
,
Runtime
,
worker
::
Worker
};
async
fn
hello_world
(
_
runtime
:
Runtime
)
->
Result
<
()
>
{
Ok
(())
...
...
lib/runtime/tests/pipeline.rs
View file @
bce74588
...
...
@@ -15,17 +15,17 @@
#![allow(dead_code)]
use
futures
::{
stream
,
StreamExt
};
use
futures
::{
StreamExt
,
stream
};
use
serde
::{
Deserialize
,
Serialize
};
use
std
::{
sync
::
Arc
,
time
::
Duration
};
use
dynamo_runtime
::
engine
::
ResponseStream
;
use
dynamo_runtime
::{
Error
,
pipeline
::{
async_trait
,
AsyncEngine
,
Data
,
Event
,
ManyOut
,
Operator
,
ServiceBackend
,
ServiceEngine
,
ServiceFrontend
,
SingleIn
,
*
,
AsyncEngine
,
Data
,
Event
,
ManyOut
,
Operator
,
ServiceBackend
,
ServiceEngine
,
ServiceFrontend
,
SingleIn
,
async_trait
,
*
,
},
Error
,
};
mod
common
;
...
...
@@ -153,8 +153,8 @@ fn make_postprocessor() -> Arc<PipelineNode<ManyOut<Annotated<String>>, ManyOut<
// Node 0:
// [frontend] -------[pre processor]-----> [backend]
// [frontend] <----- [post processor] ---- [backend]
fn
make_service
(
)
->
Result
<
ServiceEngine
<
SingleIn
<
String
>
,
ManyOut
<
Annotated
<
String
>>>
,
PipelineError
>
{
fn
make_service
(
)
->
Result
<
ServiceEngine
<
SingleIn
<
String
>
,
ManyOut
<
Annotated
<
String
>>>
,
PipelineError
>
{
// Frontend - Callable interface
let
frontend
=
ServiceFrontend
::
<
SingleIn
<
String
>
,
ManyOut
<
Annotated
<
String
>>>
::
new
();
...
...
@@ -253,14 +253,16 @@ async fn test_disaggregated_service() {
// }
// assert_eq!(counter, 20);
println!
(
"Test blocked: SegmentSink::attach requires Arc<dyn AsyncEngine> but AsyncEngineStream cannot be Sync"
);
println!
(
"Test blocked: SegmentSink::attach requires Arc<dyn AsyncEngine> but AsyncEngineStream cannot be Sync"
);
}
// Node 0:
// [frontend] --> [pre processor] --> [operator] ----------------------> [backend]
// [frontend] <---------------------- [operator] <--[post processor] <-- [backend]
fn
make_service_with_operator
(
)
->
Result
<
ServiceEngine
<
SingleIn
<
String
>
,
ManyOut
<
Annotated
<
String
>>>
,
PipelineError
>
{
fn
make_service_with_operator
(
)
->
Result
<
ServiceEngine
<
SingleIn
<
String
>
,
ManyOut
<
Annotated
<
String
>>>
,
PipelineError
>
{
// Frontend - Callable interface
let
frontend
=
ServiceFrontend
::
<
SingleIn
<
String
>
,
ManyOut
<
Annotated
<
String
>>>
::
new
();
...
...
lib/runtime/tests/soak.rs
View file @
bce74588
...
...
@@ -30,18 +30,18 @@ mod integration {
pub
const
DEFAULT_NAMESPACE
:
&
str
=
"dynamo"
;
use
dynamo_runtime
::{
logging
,
DistributedRuntime
,
ErrorContext
,
Result
,
Runtime
,
Worker
,
logging
,
pipeline
::{
async_trait
,
network
::
Ingress
,
AsyncEngine
,
AsyncEngineContextProvider
,
Error
,
ManyOut
,
PushRouter
,
ResponseStream
,
SingleIn
,
AsyncEngine
,
AsyncEngineContextProvider
,
Error
,
ManyOut
,
PushRouter
,
ResponseStream
,
SingleIn
,
async_trait
,
network
::
Ingress
,
},
protocols
::
annotated
::
Annotated
,
stream
,
DistributedRuntime
,
ErrorContext
,
Result
,
Runtime
,
Worker
,
stream
,
};
use
futures
::
StreamExt
;
use
std
::{
sync
::
atomic
::{
AtomicU64
,
Ordering
},
sync
::
Arc
,
sync
::
atomic
::{
AtomicU64
,
Ordering
},
time
::
Duration
,
};
use
tokio
::
time
::
Instant
;
...
...
rust-toolchain.toml
View file @
bce74588
[toolchain]
channel
=
"1.8
7
.0"
channel
=
"1.8
9
.0"
Prev
1
…
6
7
8
9
10
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment