5 ms·
Would someone seriously encounter a defect like that? Who would set a function to run after ~25 days (2^31 milliseconds) and expect that that process still runs
by jschulenklopper 8y ago
Would someone seriously encounter a defect like that? Who would set a function to run after ~25 days (2^31 milliseconds) and expect that that process still runs after all those days? You're not safeguarding yourself against the very likely situation that processes could stop over such a long period.
Also, considering the length of that period, it's most likely that the delay for the function-to-be-called is from a business (and not some technical) requirement. So, a more fitting design would be to set up a delayed job for asynchronously executing long-running or later tasks in the background by a scheduler.
- jschulenklopper 8y agoSo, kudos to the maintainer to solve the issue, as it is a valid bug to be fixed... but it's not likely (or a case of suboptimal design) that such a defect would ever be encountered for real.
- Vendan 8y agoI quite often write stuff with a function that gets called every few minutes or seconds... which is what the bug was actually discovered on. That's not suboptimal design.
- jschulenklopper 8y agoAgreed. A scheduling process that stops (does not call functions anymore) after 25 days is a strange phenomenon. I misread the post title.
- tedunangst 8y agoWhat? The scheduled delay isn't 25 days.
- jschulenklopper 8y agoNo, I realized later. But also that case wouldn't have worked :-)
- tobr 8y agoConceptually they are not scheduling a function to be run after a month, but scheduling it to run twice per second as long as the process is running. When the process is still running a month later, it is very unexpected that the scheduling would suddenly stop.
- jschulenklopper 8y agoMy bad, perhaps because of the original (or confusing) post title earlier. A scheduling process that stops after 25 days is indeed a more realistic bug than a function planned for execution in 25 days not being called.
- moefh 8y agoThe bug happened for setInterval() with any timeout (the bug report is for one with 500 milliseconds). The problem is that the function that returned the current time was overflowing a 32-bit integer, so interval calculations were messed up and setInteval() wouldn't fire. The fix[1] was simply to change an int to an unsigned int. [1] https://github.com/nodejs/node/pull/22214/commits/3bb7fdfbbeb7e9f727314608f393858661b94346#diff-740094b363a8e0203beab60946cc3adeL620 https://github.com/nodejs/node/pull/22214/commits/3bb7fdfbbe...