Skip to content

Commit 1e433fd

Browse files
authored
Revert "merge dev in staging perf" (#2990)
Reverts #2989
2 parents 19a3a66 + bc63b32 commit 1e433fd

25 files changed

+278
-513
lines changed

.changesets/fix_geal_context_mutex.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changesets/fix_geal_null_field_formatter.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changesets/maint_garypen_jemalloc.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.changesets/maint_geal_path_manipulation.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changesets/maint_geal_private_context.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

Cargo.lock

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ dependencies = [
344344
"opentelemetry-semantic-conventions",
345345
"opentelemetry-zipkin",
346346
"p256 0.12.0",
347-
"parking_lot 0.12.1",
348347
"paste",
349348
"pin-project-lite",
350349
"prometheus",
@@ -378,7 +377,6 @@ dependencies = [
378377
"test-log",
379378
"test-span",
380379
"thiserror",
381-
"tikv-jemallocator",
382380
"tokio",
383381
"tokio-rustls",
384382
"tokio-stream",
@@ -5882,26 +5880,6 @@ dependencies = [
58825880
"tower",
58835881
]
58845882

5885-
[[package]]
5886-
name = "tikv-jemalloc-sys"
5887-
version = "0.5.3+5.3.0-patched"
5888-
source = "registry+https://github.com/rust-lang/crates.io-index"
5889-
checksum = "a678df20055b43e57ef8cddde41cdfda9a3c1a060b67f4c5836dfb1d78543ba8"
5890-
dependencies = [
5891-
"cc",
5892-
"libc",
5893-
]
5894-
5895-
[[package]]
5896-
name = "tikv-jemallocator"
5897-
version = "0.5.0"
5898-
source = "registry+https://github.com/rust-lang/crates.io-index"
5899-
checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979"
5900-
dependencies = [
5901-
"libc",
5902-
"tikv-jemalloc-sys",
5903-
]
5904-
59055883
[[package]]
59065884
name = "time"
59075885
version = "0.3.20"

apollo-router/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,12 @@ yaml-rust = "0.4.5"
203203
wsl = "0.1.0"
204204
tokio-rustls = "0.23.4"
205205
http-serde = "1.1.2"
206-
parking_lot = "0.12.1"
207206

208207
[target.'cfg(macos)'.dependencies]
209208
uname = "0.1.1"
210209

211210
[target.'cfg(unix)'.dependencies]
212211
uname = "0.1.1"
213-
tikv-jemallocator = "0.5"
214212

215213
[dev-dependencies]
216214
ecdsa = { version = "0.15.1", features = ["signing", "pem", "pkcs8"] }
@@ -258,4 +256,3 @@ tonic-build = "0.8.4"
258256
[[test]]
259257
name = "integration_tests"
260258
path = "tests/integration_tests.rs"
261-

apollo-router/src/axum_factory/axum_http_server_factory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ async fn handle_graphql(
436436
let context = request.context.clone();
437437

438438
let res = service.oneshot(request).await;
439-
let dur = context.busy_time();
439+
let dur = context.busy_time().await;
440440
let processing_seconds = dur.as_secs_f64();
441441

442442
tracing::info!(histogram.apollo_router_processing_time = processing_seconds,);

apollo-router/src/context/mod.rs renamed to apollo-router/src/context.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ use std::time::Instant;
1010
use dashmap::mapref::multiple::RefMulti;
1111
use dashmap::mapref::multiple::RefMutMulti;
1212
use dashmap::DashMap;
13-
use derivative::Derivative;
14-
use parking_lot::Mutex;
13+
use futures::lock::Mutex;
1514
use serde::Deserialize;
1615
use serde::Serialize;
1716
use tower::BoxError;
1817

19-
use self::extensions::Extensions;
2018
use crate::json_ext::Value;
2119

22-
pub(crate) mod extensions;
23-
2420
/// Holds [`Context`] entries.
2521
pub(crate) type Entries = Arc<DashMap<String, Value>>;
2622

@@ -35,22 +31,17 @@ pub(crate) type Entries = Arc<DashMap<String, Value>>;
3531
/// [`crate::services::SubgraphResponse`] processing. At such times,
3632
/// plugins should restrict themselves to the [`Context::get`] and [`Context::upsert`]
3733
/// functions to minimise the possibility of mis-sequenced updates.
38-
#[derive(Clone, Deserialize, Serialize, Derivative)]
39-
#[derivative(Debug)]
34+
#[derive(Clone, Debug, Deserialize, Serialize)]
4035
pub struct Context {
4136
// Allows adding custom entries to the context.
4237
entries: Entries,
4338

44-
#[serde(skip, default)]
45-
pub(crate) private_entries: Arc<parking_lot::Mutex<Extensions>>,
46-
4739
/// Creation time
4840
#[serde(skip)]
4941
#[serde(default = "Instant::now")]
5042
pub(crate) created_at: Instant,
5143

5244
#[serde(skip)]
53-
#[derivative(Debug = "ignore")]
5445
busy_timer: Arc<Mutex<BusyTimer>>,
5546
}
5647

@@ -59,7 +50,6 @@ impl Context {
5950
pub fn new() -> Self {
6051
Context {
6152
entries: Default::default(),
62-
private_entries: Arc::new(parking_lot::Mutex::new(Extensions::default())),
6353
created_at: Instant::now(),
6454
busy_timer: Arc::new(Mutex::new(BusyTimer::new())),
6555
}
@@ -196,18 +186,18 @@ impl Context {
196186
}
197187

198188
/// Notify the busy timer that we're waiting on a network request
199-
pub(crate) fn enter_active_request(&self) {
200-
self.busy_timer.lock().increment_active_requests()
189+
pub(crate) async fn enter_active_request(&self) {
190+
self.busy_timer.lock().await.increment_active_requests()
201191
}
202192

203193
/// Notify the busy timer that we stopped waiting on a network request
204-
pub(crate) fn leave_active_request(&self) {
205-
self.busy_timer.lock().decrement_active_requests()
194+
pub(crate) async fn leave_active_request(&self) {
195+
self.busy_timer.lock().await.decrement_active_requests()
206196
}
207197

208198
/// How much time was spent working on the request
209-
pub(crate) fn busy_time(&self) -> Duration {
210-
self.busy_timer.lock().current()
199+
pub(crate) async fn busy_time(&self) -> Duration {
200+
self.busy_timer.lock().await.current()
211201
}
212202
}
213203

apollo-router/src/context/extensions.rs

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)