fix: get_connectivity(): Get rid of locking SchedulerState::inner (#7124)

`get_connectivity()` is expected to return immediately, not when the scheduler finishes updating its
state in `start_io()/stop_io()/pause_io()`, otherwise it causes app non-responsiveness.

Instead of read-locking `SchedulerState::inner`, store the `ConnectivityStore` collection in
`Context` and fetch it from there in `get_connectivity()`. Update it every time we release a write
lock on `SchedulerState::inner`.
This commit is contained in:
iequidoo
2025-08-20 11:59:15 -03:00
committed by iequidoo
parent 3656337d41
commit 6837874d43
6 changed files with 44 additions and 33 deletions

View File

@@ -734,7 +734,7 @@ impl Context {
Self::check_config(key, value)?;
let _pause = match key.needs_io_restart() {
true => self.scheduler.pause(self.clone()).await?,
true => self.scheduler.pause(self).await?,
_ => Default::default(),
};
self.set_config_internal(key, value).await?;