StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.85k stars 1.5k forks source link

Fix #2576: PhysicalConnection: Better shutdown handling #2629

Closed NickCraver closed 6 months ago

NickCraver commented 6 months ago

This adds a bit of null ref handling (few ifs). Fixes #2576.

Overall, this is biting people in the shutdown race, more likely under load, so let's eat the if checks here to prevent it. I decided to go with the specific approach here as to not affect inlining.