Skip to content

Commit

Permalink
skip memory override
Browse files Browse the repository at this point in the history
  • Loading branch information
eaypek-tfh committed Jan 16, 2025
1 parent 353390f commit 7e57052
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion deploy/stage/common-values-iris-mpc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: "ghcr.io/worldcoin/iris-mpc:v0.13.20"
image: "ghcr.io/worldcoin/iris-mpc:4c877cd1cc8d69588cef9447bb35c1c3cb6d2e4f"

environment: stage
replicaCount: 1
Expand Down
43 changes: 24 additions & 19 deletions iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ use std::{
mem,
net::IpAddr,
panic,
process::exit,
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
Arc, LazyLock, Mutex,
Expand Down Expand Up @@ -1079,6 +1080,7 @@ async fn server_main(config: Config) -> eyre::Result<()> {
let load_chunks_parallelism = config.load_chunks_parallelism;
let db_chunks_bucket_name = config.db_chunks_bucket_name.clone();
let db_chunks_folder_name = config.db_chunks_folder_name.clone();
let env = config.environment.clone();

let (tx, rx) = oneshot::channel();
background_tasks.spawn_blocking(move || {
Expand Down Expand Up @@ -1206,7 +1208,6 @@ async fn server_main(config: Config) -> eyre::Result<()> {
let left_masks = actor.left_mask_db_slices.code_gr.clone();
let right_masks = actor.right_mask_db_slices.code_gr.clone();
let device_manager_clone = actor.device_manager.clone();

let page_lock_handle = spawn_blocking(move || {
for db in [&left_codes, &right_codes] {
register_host_memory(
Expand Down Expand Up @@ -1249,13 +1250,13 @@ async fn server_main(config: Config) -> eyre::Result<()> {
StoredIris::DB(iris) => {
n_loaded_from_db += 1;
serial_ids_from_db.insert(iris.id());
actor.load_single_record_from_db(
iris.index() - 1,
iris.left_code(),
iris.left_mask(),
iris.right_code(),
iris.right_mask(),
);
// actor.load_single_record_from_db(
// iris.index() - 1,
// iris.left_code(),
// iris.left_mask(),
// iris.right_code(),
// iris.right_mask(),
// );
}
StoredIris::S3(iris) => {
if serial_ids_from_db.contains(&iris.id()) {
Expand All @@ -1267,17 +1268,17 @@ async fn server_main(config: Config) -> eyre::Result<()> {
continue;
}
n_loaded_from_s3 += 1;
actor.load_single_record_from_s3(
iris.index() - 1,
iris.left_code_odd(),
iris.left_code_even(),
iris.right_code_odd(),
iris.right_code_even(),
iris.left_mask_odd(),
iris.left_mask_even(),
iris.right_mask_odd(),
iris.right_mask_even(),
);
// actor.load_single_record_from_s3(
// iris.index() - 1,
// iris.left_code_odd(),
// iris.left_code_even(),
// iris.right_code_odd(),
// iris.right_code_even(),
// iris.left_mask_odd(),
// iris.left_mask_even(),
// iris.right_mask_odd(),
// iris.right_mask_even(),
// );
}
};

Expand Down Expand Up @@ -1313,6 +1314,10 @@ async fn server_main(config: Config) -> eyre::Result<()> {
time_loading_into_memory,
);

if env.eq("stage") {
tracing::info!("Test environment detected, exiting");
exit(0);
}
// Clear the memory allocated by temp HashSet
serial_ids_from_db.clear();
serial_ids_from_db.shrink_to_fit();
Expand Down

0 comments on commit 7e57052

Please sign in to comment.