cloudflare / foundations

Cloudflare's Rust service foundations library.
https://blog.cloudflare.com/introducing-foundations-our-open-source-rust-service-foundation-library
BSD 3-Clause "New" or "Revised" License
1.25k stars 51 forks source link

Fix potential deadlock in `link_new_trace_with_current` #26

Closed inikulin closed 7 months ago

inikulin commented 7 months ago

link_new_trace_with_current accidentially introduced the code that tried to acquire a read lock for the current span twice from the same thread. This is deadlock prone: https://docs.rs/lock_api/0.3.2/lock_api/struct.RwLock.html#method.read