Skip to content

Commit

Permalink
Change '>=' back to '>' to fix recycling of blobs/packets
Browse files Browse the repository at this point in the history
Recycler will have a strong ref to the item so it will be at
least 1, >= will always prevent recycling.
  • Loading branch information
sakridge committed Sep 11, 2018
1 parent b313b7f commit 9139112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl<T: Default + Reset> Recycler<T> {
// be passed across threads ('alloc' is a nightly-only API), and so our
// reference-counted recyclables are awkwardly being recycled by hand,
// which allows this race condition to exist.
if Arc::strong_count(&x) >= 1 {
if Arc::strong_count(&x) > 1 {
// Commenting out this message, is annoying for known use case of
// validator hanging onto a blob in the window, but also sending it over
// to retransmmit_request
Expand Down

0 comments on commit 9139112

Please sign in to comment.