eliminate the state-res mutex hazard
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
82168b972a
commit
a3f9432da8
2 changed files with 0 additions and 6 deletions
|
@ -11,7 +11,6 @@ use conduwuit::{error, utils::bytes::pretty, Config, Result};
|
||||||
use data::Data;
|
use data::Data;
|
||||||
use regex::RegexSet;
|
use regex::RegexSet;
|
||||||
use ruma::{OwnedEventId, OwnedRoomAliasId, OwnedServerName, OwnedUserId, ServerName, UserId};
|
use ruma::{OwnedEventId, OwnedRoomAliasId, OwnedServerName, OwnedUserId, ServerName, UserId};
|
||||||
use tokio::sync::Mutex;
|
|
||||||
|
|
||||||
use crate::service;
|
use crate::service;
|
||||||
|
|
||||||
|
@ -21,7 +20,6 @@ pub struct Service {
|
||||||
pub config: Config,
|
pub config: Config,
|
||||||
jwt_decoding_key: Option<jsonwebtoken::DecodingKey>,
|
jwt_decoding_key: Option<jsonwebtoken::DecodingKey>,
|
||||||
pub bad_event_ratelimiter: Arc<RwLock<HashMap<OwnedEventId, RateLimitState>>>,
|
pub bad_event_ratelimiter: Arc<RwLock<HashMap<OwnedEventId, RateLimitState>>>,
|
||||||
pub stateres_mutex: Arc<Mutex<()>>,
|
|
||||||
pub server_user: OwnedUserId,
|
pub server_user: OwnedUserId,
|
||||||
pub admin_alias: OwnedRoomAliasId,
|
pub admin_alias: OwnedRoomAliasId,
|
||||||
pub turn_secret: String,
|
pub turn_secret: String,
|
||||||
|
@ -70,7 +68,6 @@ impl crate::Service for Service {
|
||||||
config: config.clone(),
|
config: config.clone(),
|
||||||
jwt_decoding_key,
|
jwt_decoding_key,
|
||||||
bad_event_ratelimiter: Arc::new(RwLock::new(HashMap::new())),
|
bad_event_ratelimiter: Arc::new(RwLock::new(HashMap::new())),
|
||||||
stateres_mutex: Arc::new(Mutex::new(())),
|
|
||||||
admin_alias: OwnedRoomAliasId::try_from(format!("#admins:{}", &config.server_name))
|
admin_alias: OwnedRoomAliasId::try_from(format!("#admins:{}", &config.server_name))
|
||||||
.expect("#admins:server_name is valid alias name"),
|
.expect("#admins:server_name is valid alias name"),
|
||||||
server_user: UserId::parse_with_server_name(
|
server_user: UserId::parse_with_server_name(
|
||||||
|
|
|
@ -116,9 +116,6 @@ pub async fn state_resolution(
|
||||||
state_sets: &[StateMap<OwnedEventId>],
|
state_sets: &[StateMap<OwnedEventId>],
|
||||||
auth_chain_sets: &[HashSet<OwnedEventId>],
|
auth_chain_sets: &[HashSet<OwnedEventId>],
|
||||||
) -> Result<StateMap<OwnedEventId>> {
|
) -> Result<StateMap<OwnedEventId>> {
|
||||||
//TODO: ???
|
|
||||||
let _lock = self.services.globals.stateres_mutex.lock();
|
|
||||||
|
|
||||||
state_res::resolve(
|
state_res::resolve(
|
||||||
room_version,
|
room_version,
|
||||||
state_sets.iter(),
|
state_sets.iter(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue