Skip to content

Commit

Permalink
Pause the cleaner thread for the tail of the execution time
Browse files Browse the repository at this point in the history
This avoids running the cleaner ~2x as often as expected.
  • Loading branch information
Mark-Simulacrum committed Jan 2, 2025
1 parent a54686e commit 5373036
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dc/s2n-quic-dc/src/path/secret/map/cleaner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ impl Cleaner {
break;
}
state.cleaner().clean(&state, EVICTION_CYCLES);
// pause the rest of the time to run once a minute, not twice a minute
std::thread::park_timeout(Duration::from_secs(60 - pause));
})
.unwrap();
*self.thread.lock().unwrap() = Some(handle);
Expand Down

0 comments on commit 5373036

Please sign in to comment.