Prevent Race condition in REST api
I have an api that creates a signing session between two users. This api checks if there is an existing signing session or there was signing request in past. It uses that session instead of creating new.
Problem here is that if both users create separate signing session. This is only possible if both user start near instantaneously.
I am thinking of either adding message queue strategy or using socket instead http call.
I am also worried that socket strategy will also introduce race conditions.
Message Queue strategy sound nice but we are not using Message Queue strategy anywhere in project. I do not want to add new technologies into project unless existing can not server my need.