transaction: Implement Card::reconnect() wrapper#56
Conversation
|
Just to make sure, you tested that reconnect works as expected inside of a transaction, the transaction doesn't end? I mostly expect it not to work. One hitch with this is that it would technically allow doing TBH, I regret using |
Yes, I have tested it. It works and solves the race condition. In fact, we have been using That being said, I can only tell for pcscd on Linux, not Windows or MacOS.
Right, I did not think about that. I did some tests:
I agree. |
|
OK, makes sense. So let's add a |
This gives us access to Card::reconnect() from within a transaction so that we can check the card status and reset it conditionally with no interference from other processes. This fixes a race condition I had between two processes where both processes passed the status check resulting in two card resets. Signed-off-by: Konrad Vité <kvite@paktolos.net>
b0f43e3 to
9883932
Compare
This gives us access to
Card::reconnect()from within a transaction so that we can check the card status and reset it conditionally with no interference from other processes.This fixes a race condition I had between two processes where both processes passed the status check resulting in two card resets.