Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Handle closing of the program in the same slot as deployment #33025

Merged
merged 2 commits into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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