3 ms·
tokio-postgres handles this by just dispatching the "ROLLBACK" command in impl Drop and ignoring the response. https://github.com/rust-postgres/rust-postgres/bl
by 0x1ceb00da 1y ago
tokio-postgres handles this by just dispatching the "ROLLBACK" command in impl Drop and ignoring the response. https://github.com/rust-postgres/rust-postgres/blob/a7a49a90734c05664ed56356b61aa937cc2a6e6b/tokio-postgres/src/client.rs#L606 https://github.com/rust-postgres/rust-postgres/blob/a7a49a90...
Is this not enough? What could go wrong? If the network connection dies or the task is cancelled, I'm assuming the database server cleans up the connection state and does a rollback automatically.
And adding async Drop will probably add a whole new set of footguns.
- _davide_ 1y ago> What could go wrong? LoL, an insane amount of things. TCP connections are an illusion of safely, for the purpose of database commits use UDP packets as a model instead, it'll be much closer to reality.
- 0x1ceb00da 1y ago> an insane amount of things List a couple > TCP connections are an illusion of safely Why?