templates icon indicating copy to clipboard operation
templates copied to clipboard

Check select! bug in async

Open joshka opened this issue 11 months ago • 3 comments

I suspect that this is still a bug as the select can complete on either branch of the select in a non-deterministic fashion. The right way to handle (I think) is to not fail when the sender fails to send. The send failing can indicator that the receiver is closed. See https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Sender.html

I think there's probably a second bug with this in how cancelations are handled https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Sender.html#cancel-safety

Originally posted by @joshka in https://github.com/ratatui-org/templates/pull/48#pullrequestreview-1913139384

joshka avatar Mar 04 '24 05:03 joshka

Sorry for late response, I am in school now. Maybe we need a simplified test to validate this

MMitsuha avatar Mar 04 '24 14:03 MMitsuha

Is this still an issue?

orhun avatar May 18 '24 20:05 orhun

This is mostly a prompt to check whether this is a bug at some point. I haven't looked into it more than superficially.

joshka avatar May 19 '24 00:05 joshka