This logic seems very broken.

This line can set sender_drain to 2 since it adds 1, and then the compare_and_swap below will always fail, leading to an infinite loop, since no other code touches sender_drain.