From fceef849cf709ff280865615142f0e68120f7dbf Mon Sep 17 00:00:00 2001 From: Jane Lusby Date: Mon, 30 Nov 2020 16:47:44 -0800 Subject: [PATCH] remove unused mutability to defuse deadlock --- zebrad/src/components/tracing/component.rs | 2 +- zebrad/src/components/tracing/endpoint.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zebrad/src/components/tracing/component.rs b/zebrad/src/components/tracing/component.rs index 0d0e56a3..491dba73 100644 --- a/zebrad/src/components/tracing/component.rs +++ b/zebrad/src/components/tracing/component.rs @@ -55,7 +55,7 @@ impl Tracing { /// Reload the currently-active filter with the supplied value. /// /// This can be used to provide a dynamic tracing filter endpoint. - pub fn reload_filter(&mut self, filter: impl Into) { + pub fn reload_filter(&self, filter: impl Into) { self.filter_handle .reload(filter) .expect("the subscriber is not dropped before the component is"); diff --git a/zebrad/src/components/tracing/endpoint.rs b/zebrad/src/components/tracing/endpoint.rs index b406cacf..353bd0ba 100644 --- a/zebrad/src/components/tracing/endpoint.rs +++ b/zebrad/src/components/tracing/endpoint.rs @@ -104,10 +104,10 @@ To set the filter, POST the new filter string to /filter: .expect("response with known status code cannot fail"), (&Method::POST, "/filter") => match read_filter(req).await { Ok(filter) => { - app_writer() - .state_mut() + app_reader() + .state() .components - .get_downcast_mut::() + .get_downcast_ref::() .expect("Tracing component should be available") .reload_filter(filter);