Refactored ensure ring size to use yz_rt:wait_until/2 correctly.