Skip to content

Commit

Permalink
v1.17 - Adds error log for replacements in ProgramCache::assign_progr…
Browse files Browse the repository at this point in the history
…am(). (#1400)

Adds error log for replacements in ProgramCache::assign_program().
  • Loading branch information
Lichtso authored and yihau committed May 18, 2024
1 parent 6a2c857 commit b04a806
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,13 @@ impl<FG: ForkGraph> LoadedPrograms<FG> {
(false, entry)
} else {
// Something is wrong, I can feel it ...
let existing = existing.clone();
error!(
"ProgramCache::assign_program() failed key={:?} existing={:?} entry={:?}",
key, slot_versions, entry
);
self.stats.replacements.fetch_add(1, Ordering::Relaxed);
(true, existing.clone())
(true, existing)
}
}
Err(index) => {
Expand All @@ -699,7 +704,7 @@ impl<FG: ForkGraph> LoadedPrograms<FG> {
entry: Arc<LoadedProgram>,
) -> (bool, Arc<LoadedProgram>) {
let (was_occupied, entry) = self.replenish(key, entry);
debug_assert!(!was_occupied);
debug_assert!(!was_occupied, "Unexpected replacement of an entry");
(was_occupied, entry)
}

Expand Down
1 change: 1 addition & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5223,6 +5223,7 @@ impl Bank {
));

if programs_loaded_for_tx_batch.borrow().hit_max_limit {
error!("Discarding TX batch {:#?}", batch.sanitized_transactions());
return LoadAndExecuteTransactionsOutput {
loaded_transactions: vec![],
execution_results: vec![],
Expand Down

0 comments on commit b04a806

Please sign in to comment.