Skip to content

Commit

Permalink
bugfix: additional improvements to nym-api db performance (#5168)
Browse files Browse the repository at this point in the history
* added statement logging to nym-api db

* adding additional pool options

* dont blow up upon failing to submit network monitor results

* store in-memory cache of node database ids
  • Loading branch information
jstuczyn authored Nov 22, 2024
1 parent 01c7b28 commit 6acd936
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 131 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nym-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ bloomfilter = { workspace = true }
cfg-if = { workspace = true }
clap = { workspace = true, features = ["cargo", "derive", "env"] }
console-subscriber = { workspace = true, optional = true } # validator-api needs to be built with RUSTFLAGS="--cfg tokio_unstable"
dashmap = { workspace = true }
dirs = { workspace = true }
futures = { workspace = true }
itertools = { workspace = true }
Expand Down
6 changes: 1 addition & 5 deletions nym-api/src/network_monitor/monitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use nym_sphinx::params::PacketType;
use nym_sphinx::receiver::MessageReceiver;
use nym_task::TaskClient;
use std::collections::{HashMap, HashSet};
use std::process;
use tokio::time::{sleep, Duration, Instant};
use tracing::{debug, error, info, trace};

Expand Down Expand Up @@ -95,10 +94,7 @@ impl<R: MessageReceiver + Send> Monitor<R> {
)
.await
{
error!("Failed to submit monitor run information to the database - {err}",);

// TODO: slightly more graceful shutdown here
process::exit(1);
error!("Failed to submit monitor run information to the database: {err}",);
}
}

Expand Down
2 changes: 0 additions & 2 deletions nym-api/src/node_status_api/handlers/without_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ pub(crate) async fn submit_gateway_monitoring_results(

match state
.storage
.manager
.submit_gateway_statuses_v2(message.results())
.await
{
Expand Down Expand Up @@ -134,7 +133,6 @@ pub(crate) async fn submit_node_monitoring_results(

match state
.storage
.manager
.submit_mixnode_statuses_v2(message.results())
.await
{
Expand Down
Loading

0 comments on commit 6acd936

Please sign in to comment.