hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

Consistency Flaws: Races and Outages should be considered

Open kos-for-juspay opened this issue 1 year ago • 0 comments

possible race condition here. what if a concurrent user updates parent merchant between this operation and the following? https://github.com/juspay/orca/blob/56d153d8f7c2c75391799cf14280c448df97842f/crates/router/src/core/admin.rs#L74-L79

possible race condition here. what if a concurrent user updates merchant account between this read and the last write? https://github.com/juspay/orca/blob/56d153d8f7c2c75391799cf14280c448df97842f/crates/router/src/core/admin.rs#L148-L153

possible race condition here. what if a concurrent user updates parent merchant between this operation and the following? https://github.com/juspay/orca/blob/56d153d8f7c2c75391799cf14280c448df97842f/crates/router/src/core/admin.rs#L205-L212

What if the application process would be killed after successful execution of delete_payment_method_by_merchant_id_payment_method_id(), but before executing delete_card()? Would be the card ever deleted? Seems like the system has weak consistency guarantees.

https://docs.diesel.rs/diesel/connection/trait.Connection.html#method.transaction

https://github.com/juspay/orca/blob/56d153d8f7c2c75391799cf14280c448df97842f/crates/router/src/core/payment_methods/cards.rs#L430-L434

kos-for-juspay avatar Dec 12 '22 09:12 kos-for-juspay