Systems are absolutely not ready. Leap seconds are a bad idea and negative leap seconds are worse. Just don't do it and let the drift cancel out.
Systems are absolutely not ready. Leap seconds are a bad idea and negative leap seconds are worse. Just don't do it and let the drift cancel out.
Explain why negative leap seconds are worse? Intuitively it seems like normal leap seconds would cause way more issues, or at least not more.
I am not an expert in Time systems but I imagine the problem is similar to daylight savings problems. With a leap second it's like putting the clocks forward an hour. With daylight savings, In your time series database you suddenly go from 0059 to 0200. 0100-0159 are missing, but that's fine. Most systems are fine with missing data, because we assume there will be occasional outages and such
When you go the other direction there's a potential problem. You have records with times from 0100-0159, then the daylight savings shift happens and you repeat 0100-0159. Now you have records with (apparently) duplicate timestamps.
I think it's probably the same problem with leap seconds and negative leap seconds, but I'm not 100% sure
Negative leap seconds mean we skip a second, normal leap seconds are the ones where we repeate a second.
Huh. TIL
That's really unintuitive. Thank you for letting me know
negative leap seconds aren't too bad. jumping forward a second won't lead to a time loop like jumping back did on several systems (some twice!)
Unless you have something scheduled for that second.
What's worse about negative leap seconds? The "experienced" time by systems will just look like they froze for a second. Added leap seconds are worse, surely, as time goes backwards.
Suppose being charged by time used to run your tasks. Then your task takes -1 second, you will be charged zero, 1 second, or 18 quintillon seconds?
That's exactly what I see happening when a leap second is ADDED.
A leap second is added. The system goes "oh shit, I'm a second ahead", and subtracts a second. And that's how you get a negative duration and exactly this problem.
Whereas if a leap second is subtracted, you get charged for an extra second.
That shouldn't be the case?
When a negative leap second is applied it just means that 23:59:59 is skipped. The seconds go 56 57 58 0 1 2 3.
vs a positive leap second where time goes 56 57 58 59 60 0 1 2 3.
So if you are billed by time and it's tracked via a timer then your time is still accurate but if it's tracked by reading your start and end time then your billing will just read an extra second.
Positive leap seconds are harder as they require you to reason about a clock that includes a 60th second but systems view negative leap seconds as if nothing happened for an entire second.
Now there are some cases where this runs into issues. If you have jobs that fire off based on the time then you can get jobs running a second early. Normally this shouldn't be a problem but in some cases this could result in contention of resources.
You could also accidentally trigger watchdogs but any watchdog worth its salt will use a real timer not wall time.
But overall negative leap seconds are way easier as they are still monotonically increasing and don't require downstream systems even understanding the concept of a leap second in the first place.
> just read an extra second [...] accidentally trigger watchdogs
Well, this seems to touch heavily on the concern: if your job normally takes 0.1s and costs $100, it could accidentally be considered to have taken 1.1s and therefore cost $1100. This is quite contrived, but if you consider that some people put very infrequent cron jobs at the top of the hour (which isn't typically the best idea, but I digress) and it might start just ahead of what the billing system considers to be the top of the hour, theoretically there's something to this concern.
If you're calculating time that a task took by subtracting two UTC datetimes instead of just using a monotonic timer or at least unix timestamps, you're doing it wrong either way
If systems are not ready, then there is plenty of room of systems doing it the wrong way.