Skip to content
#0965
ContainersCron

Renewal is a compare-and-swap on a date

The renewal cron fires at 03:00 on the 27th. The network flaps mid-request. The cron fires again.

On most platforms that is two renewals. On Hoody the extend call carries expected_rental_end, the rental's current end date exactly as GET /api/v1/rentals/{id} returned it. The extension applies only if that value still matches. The second request finds a rental that already ends a month later and gets 409 EXTENSION_ALREADY_APPLIED. No second charge. The script logs the 409 and goes back to sleep.

The price is in the same record: renewal_pricing_frozen holds a frozen renewal price, and frozen tiers are the ceiling. If a rental lapses anyway, hold_days keeps the box alive a day or two before anything is deleted.

Renewal is a compare-and-swap on a date.