Skip to content

Commit

Permalink
fix(sn_node): resolve OOM issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Jun 13, 2023
1 parent 3bf7ea0 commit d44d64f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sn_record_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ impl RecordStore for DiskBackedRecordStore {
let num_records = self.records.len();
if num_records >= self.config.max_records {
warn!("Record not stored. Maximum number of records reached. Current num_records: {num_records}");
return Err(Error::MaxRecords);
// To avoid returning error causing libp2p holding un-necessary copy in cache,
// to achieve specified `quorumn::ALL` successes,
// which may result in OOM(Out Of Memory) issue under certain network circumstance.
// Here returning `OK` instead of `Error::MaxRecords`.
return Ok(());
}

let filename = Self::key_to_hex(&r.key);
Expand Down

0 comments on commit d44d64f

Please sign in to comment.