From 328a681a109e9a6007690f0cd3f2040bd3ac9bae Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Tue, 12 Oct 2021 11:02:19 +0200 Subject: [PATCH] ref: Update deps and remove dead-stores (#566) --- Cargo.lock | 99 ++++++++++--------- crates/symbolicator/Cargo.toml | 2 +- crates/symbolicator/src/services/cficaches.rs | 22 ++--- crates/symbolicator/src/services/minidump.rs | 2 - crates/symbolicator/src/services/mod.rs | 5 +- .../src/services/objects/data_cache.rs | 4 +- .../src/services/symbolication.rs | 8 +- crates/symbolicator/src/services/symcaches.rs | 11 +-- 8 files changed, 68 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d36b4b427..cc216c900 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "991984e3fd003e7ba02eb724f87a0f997b78677c46c0e91f8424ad7394c9886a" dependencies = [ "getrandom 0.2.3", "once_cell", @@ -51,6 +51,9 @@ name = "anyhow" version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" +dependencies = [ + "backtrace", +] [[package]] name = "apple-crash-report-parser" @@ -122,9 +125,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "axum" -version = "0.2.5" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6519a24c07bab4effe38e226c447faef56869f99aa66aa92502aba7ad47b168" +checksum = "8f08f95a202e827209db1491047aa57c18c8adb4c5efcfcfd4a2da4838ee3a72" dependencies = [ "async-trait", "bitflags", @@ -297,9 +300,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" dependencies = [ "jobserver", ] @@ -995,9 +998,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f3675cfef6a30c8031cf9e6493ebdc3bb3272a3fea3923c4210d1830e6a472" +checksum = "6c06815895acec637cd6ed6e9662c935b866d20a106f8361892893a7d9234964" dependencies = [ "bytes", "fnv", @@ -1378,9 +1381,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "leb128" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" @@ -1415,9 +1418,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.6.6" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ea2d928b485416e8908cff2d97d621db22b27f7b3b6729e438bcf42c671ba91" +checksum = "6c748cfe47cb8da225c37595b3108bea1c198c84aaae8ea0ba76d01dda9fc803" dependencies = [ "hashbrown", ] @@ -1542,9 +1545,9 @@ dependencies = [ [[package]] name = "minimal-lexical" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" +checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" [[package]] name = "miniz_oxide" @@ -2052,7 +2055,7 @@ name = "process-event" version = "0.3.4" dependencies = [ "anyhow", - "reqwest 0.11.4", + "reqwest 0.11.5", "serde", "serde_json", "structopt", @@ -2081,9 +2084,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -2288,9 +2291,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22" +checksum = "51c732d463dd300362ffb44b7b125f299c23d2990411a4253824630ebc7467fb" dependencies = [ "base64 0.13.0", "bytes", @@ -2539,10 +2542,10 @@ checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" [[package]] name = "sentry" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "httpdate", - "reqwest 0.11.4", + "reqwest 0.11.5", "sentry-anyhow", "sentry-backtrace", "sentry-contexts", @@ -2557,7 +2560,7 @@ dependencies = [ [[package]] name = "sentry-anyhow" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "anyhow", "sentry-backtrace", @@ -2567,7 +2570,7 @@ dependencies = [ [[package]] name = "sentry-backtrace" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "backtrace", "lazy_static", @@ -2578,7 +2581,7 @@ dependencies = [ [[package]] name = "sentry-contexts" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "hostname", "lazy_static", @@ -2592,7 +2595,7 @@ dependencies = [ [[package]] name = "sentry-core" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "chrono", "lazy_static", @@ -2605,7 +2608,7 @@ dependencies = [ [[package]] name = "sentry-debug-images" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "findshlibs", "lazy_static", @@ -2615,7 +2618,7 @@ dependencies = [ [[package]] name = "sentry-log" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "log", "sentry-core", @@ -2624,7 +2627,7 @@ dependencies = [ [[package]] name = "sentry-panic" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "sentry-backtrace", "sentry-core", @@ -2633,7 +2636,7 @@ dependencies = [ [[package]] name = "sentry-tower" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "sentry-core", "tower-layer", @@ -2643,7 +2646,7 @@ dependencies = [ [[package]] name = "sentry-types" version = "0.23.0" -source = "git+https://github.com/getsentry/sentry-rust#420444d59206e86f5d010f7d1f6b4e1088e44aae" +source = "git+https://github.com/getsentry/sentry-rust#9e0cb222713e2336c66c32ad842e37b1b2418968" dependencies = [ "chrono", "debugid", @@ -3065,9 +3068,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.77" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0" +checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ "proc-macro2", "quote", @@ -3082,9 +3085,9 @@ checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" [[package]] name = "synstructure" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", @@ -3145,18 +3148,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -3210,9 +3213,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110" +checksum = "154794c8f499c2619acd19e839294703e9e32e7630ef5f46ea80d4ef0fbee5eb" dependencies = [ "proc-macro2", "quote", @@ -3313,9 +3316,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", "log", @@ -3326,9 +3329,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98863d0dd09fa59a1b79c6750ad80dbda6b75f4e71c437a6a1a8cb91a8bcbd77" +checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", @@ -3337,9 +3340,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] @@ -3471,9 +3474,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246f4c42e67e7a4e3c6106ff716a5d067d4132a642840b242e357e468a2a0085" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" diff --git a/crates/symbolicator/Cargo.toml b/crates/symbolicator/Cargo.toml index b9a681717..f7676986e 100644 --- a/crates/symbolicator/Cargo.toml +++ b/crates/symbolicator/Cargo.toml @@ -25,7 +25,7 @@ ipnetwork = "0.18.0" jsonwebtoken = "7.2.0" lazy_static = "1.4.0" log = { version = "0.4.13", features = ["serde"] } -lru = "0.6.3" +lru = "0.7.0" num_cpus = "1.13.0" minidump = "0.3" parking_lot = "0.11.1" diff --git a/crates/symbolicator/src/services/cficaches.rs b/crates/symbolicator/src/services/cficaches.rs index c2d39a708..d1913f4c2 100644 --- a/crates/symbolicator/src/services/cficaches.rs +++ b/crates/symbolicator/src/services/cficaches.rs @@ -87,10 +87,12 @@ impl CfiCacheActor { #[derive(Debug)] pub struct CfiCacheFile { - object_type: ObjectType, - identifier: ObjectId, - scope: Scope, - data: ByteView<'static>, + // NOTE: ideally this would keep the ByteView it could receive via CacheItemRequest::load + // however we only use this file by opening it by filename from a subprocess. Until we can + // pass a filedescriptor to the subprocess instead of a filename there is no point in storing + // this ByteView and instead we only rely on the cache semantics of touching the mtime + // before returning a cache item to ensure the cleanup process will not remove this while + // we are using it. features: ObjectFeatures, status: CacheStatus, path: CachePath, @@ -200,9 +202,9 @@ impl CacheItemRequest for FetchCfiCacheInternal { fn load( &self, - scope: Scope, + _scope: Scope, status: CacheStatus, - data: ByteView<'static>, + _data: ByteView<'static>, path: CachePath, ) -> Self::Item { let mut candidates = self.candidates.clone(); @@ -213,10 +215,6 @@ impl CacheItemRequest for FetchCfiCacheInternal { ); CfiCacheFile { - object_type: self.request.object_type, - identifier: self.request.identifier.clone(), - scope, - data, features: self.meta_handle.features(), status, path, @@ -270,10 +268,6 @@ impl CfiCacheActor { .await } None => Ok(Arc::new(CfiCacheFile { - object_type: request.object_type, - identifier: request.identifier, - scope: request.scope, - data: ByteView::from_slice(b""), features: ObjectFeatures::default(), status: CacheStatus::Negative, path: CachePath::new(), diff --git a/crates/symbolicator/src/services/minidump.rs b/crates/symbolicator/src/services/minidump.rs index 6192e510b..e28c07d0f 100644 --- a/crates/symbolicator/src/services/minidump.rs +++ b/crates/symbolicator/src/services/minidump.rs @@ -211,7 +211,6 @@ mod format { #[derive(Debug)] pub struct Format<'data> { - header: &'data RawHeader, threads: &'data [RawThread], frames: &'data [RawFrame], symbol_bytes: &'data [u8], @@ -270,7 +269,6 @@ mod format { }; Ok(Format { - header, threads, frames, symbol_bytes, diff --git a/crates/symbolicator/src/services/mod.rs b/crates/symbolicator/src/services/mod.rs index 28dec23f0..de278245e 100644 --- a/crates/symbolicator/src/services/mod.rs +++ b/crates/symbolicator/src/services/mod.rs @@ -61,8 +61,6 @@ pub struct Service { objects: ObjectsActor, /// The config object. config: Arc, - /// The download service. - downloader: Arc, } impl Service { @@ -82,7 +80,7 @@ impl Service { .clear_tmp(&config) .context("failed to clear tmp caches")?; let objects = ObjectsActor::new(caches.object_meta, caches.objects, downloader.clone()); - let bitcode = BitcodeService::new(caches.auxdifs, downloader.clone()); + let bitcode = BitcodeService::new(caches.auxdifs, downloader); let symcaches = SymCacheActor::new(caches.symcaches, objects.clone(), bitcode, cpu_pool.clone()); let cficaches = CfiCacheActor::new(caches.cficaches, objects.clone(), cpu_pool.clone()); @@ -102,7 +100,6 @@ impl Service { symbolication, objects, config, - downloader, }) } diff --git a/crates/symbolicator/src/services/objects/data_cache.rs b/crates/symbolicator/src/services/objects/data_cache.rs index 4660af2fb..877e3df3f 100644 --- a/crates/symbolicator/src/services/objects/data_cache.rs +++ b/crates/symbolicator/src/services/objects/data_cache.rs @@ -22,7 +22,7 @@ use tempfile::tempfile_in; use crate::cache::CacheStatus; use crate::logging::LogError; use crate::services::cacher::{CacheItemRequest, CacheKey, CachePath}; -use crate::services::download::{DownloadError, DownloadStatus, RemoteDif}; +use crate::services::download::{DownloadError, DownloadStatus}; use crate::types::{ObjectId, Scope}; use crate::utils::compression::decompress_object_file; use crate::utils::futures::{m, measure}; @@ -45,7 +45,6 @@ pub struct ObjectHandle { pub(super) object_id: ObjectId, pub(super) scope: Scope, - pub(super) file_source: RemoteDif, pub(super) cache_key: CacheKey, /// The mmapped object. @@ -285,7 +284,6 @@ impl CacheItemRequest for FetchFileDataRequest { object_id: self.0.object_id.clone(), scope, - file_source: self.0.file_source.clone(), cache_key: self.get_cache_key(), status, diff --git a/crates/symbolicator/src/services/symbolication.rs b/crates/symbolicator/src/services/symbolication.rs index 00e44b308..29f2e67bb 100644 --- a/crates/symbolicator/src/services/symbolication.rs +++ b/crates/symbolicator/src/services/symbolication.rs @@ -2607,9 +2607,11 @@ mod tests { .await .unwrap(); - if !matches!(&response, SymbolicationResponse::Completed(_)) { - panic!("Not a complete response: {:#?}", response); - } + assert!( + matches!(&response, SymbolicationResponse::Completed(_)), + "Not a complete response: {:#?}", + response + ); } } diff --git a/crates/symbolicator/src/services/symcaches.rs b/crates/symbolicator/src/services/symcaches.rs index b2c1baf4e..6db70d6b3 100644 --- a/crates/symbolicator/src/services/symcaches.rs +++ b/crates/symbolicator/src/services/symcaches.rs @@ -107,9 +107,6 @@ impl SymCacheActor { #[derive(Clone, Debug)] pub struct SymCacheFile { - object_type: ObjectType, - identifier: ObjectId, - scope: Scope, data: ByteView<'static>, features: ObjectFeatures, status: CacheStatus, @@ -262,7 +259,7 @@ impl CacheItemRequest for FetchSymCacheInternal { fn load( &self, - scope: Scope, + _scope: Scope, status: CacheStatus, data: ByteView<'static>, _: CachePath, @@ -280,9 +277,6 @@ impl CacheItemRequest for FetchSymCacheInternal { ); SymCacheFile { - object_type: self.request.object_type, - identifier: self.request.identifier.clone(), - scope, data, features: self.object_meta.features(), status, @@ -347,9 +341,6 @@ impl SymCacheActor { .await } None => Ok(Arc::new(SymCacheFile { - object_type: request.object_type, - identifier: request.identifier, - scope: request.scope, data: ByteView::from_slice(b""), features: ObjectFeatures::default(), status: CacheStatus::Negative,