4 ms·
Using ruby timeout led to a bug that took me 2 weeks to debug. It was causing data interleaving and corruption in redis(ie you set a key's value to 1 but it's s
by AznHisoka 11y ago
Using ruby timeout led to a bug that took me 2 weeks to debug. It was causing data interleaving and corruption in redis(ie you set a key's value to 1 but it's set to 2 instead because a separate thread set another key to 2 - that's how dangerous it is)
The sad thing is there are few viable alternatives. I forgot which one but open or read_timeout in the net::http library just uses timeout as well. So there's really no way to safely crawl a url and have it time out if it takes > x seconds.