internetee / registry

TLD Management Software
Other
46 stars 19 forks source link

Auction restart race condition on registration deadline #2641

Open vohmar opened 8 months ago

vohmar commented 8 months ago

Issue description: When registration due date arrives auction asks from the registry the latest status of the domains to determine if the domains were registered in time or not. After receiving this information status of the results is updated on the auction side and new task/job is run to set domain not registered status in registry side and send the domains back to auction. between the end of these two jobs there is a period where auction side is updated with not registered information, but registry still accepts new registration applications for the domains. This is what happened number of domains were registered during that time and ended up in the auction simultaneously.

How to avoid this scenario in the future:

option1: add new status "pending" to the auction reservation list in the registry that blocks any registration attempts while it's set. The idea is that auction system will set that status when registration deadline is reached and then continues processing the registration and auction statuses - discover if domains have been registered and if not then update registry auction list with domain not registered status and restarting the auctions. This will make sure that domain statuses are not updated while the auction and registry data exchange is going on. This does not affect auction end times nor waiting for payment states as auction system has info on those and does not need to request any information form registry. There is no need to change the database data structure for this option

option2: add registration due date column to registry auction table so that registry can check if registration request is valid independently from auction system...

will change the reservation list model, will add additional dependencies between registry and auction, but will effectively remove the time constraint and race condition. Value needs to be updated twice -

vohmar commented 7 months ago

The fix apparently did not work. Again few registrationc were accepted after midnight and also were put back to the auction.