Skip to content

Commit

Permalink
Handle closing of the program in the same slot as deployment (#33025)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 authored Aug 28, 2023
1 parent f4dcb20 commit e036a03
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,11 @@ impl LoadedPrograms {
Ordering::Relaxed,
);
second_level.remove(entry_index);
} else if existing.is_tombstone() && !entry.is_tombstone() {
// The old entry is tombstone and the new one is not. Let's give the new entry
// a chance.
} else if existing.is_tombstone() != entry.is_tombstone() {
// Either the old entry is tombstone and the new one is not.
// (Let's give the new entry a chance).
// Or, the old entry is not a tombstone and the new one is a tombstone.
// (Remove the old entry, as the tombstone makes it obsolete).
second_level.remove(entry_index);
} else {
self.stats.replacements.fetch_add(1, Ordering::Relaxed);
Expand Down

0 comments on commit e036a03

Please sign in to comment.