News for hackers. Stuff that matters.
Re:Some DNS lookups causing 5xx errors due to leap second bug by hartator on Sunday January 01, 2017 @12:11AM (#13294762)
Or maybe we just need to code system that handles leap seconds correctly.
Re:Some DNS lookups causing 5xx errors due to leap second bug by lend000 on Sunday January 01, 2017 @12:19AM (#13294776)
Two valid points. A third: convince everyone to adopt epoch time for data transfer (seconds since epoch), and let applications that require formatted time do the transformation where it will be used (not earlier). It doesn't make a lot of sense that a timestamp represented as HOUR/MIN/SEC:DAY/YEAR should be passed around on the network of a production system. Leave it to the recipient to convert. I guess this is a subset of your point.
Re:Some DNS lookups causing 5xx errors due to leap second bug by rspeer on Sunday January 01, 2017 @12:48AM (#13294836)
Leap seconds aren't just an issue of formatting times. Leap seconds actually involve turning the UTC count of seconds back by a second.

You'd have to switch the "seconds since epoch" count to TAI, and that would cause new formatting bugs because all kinds of software assumes that the minute changes on a multiple of 60 seconds since the epoch.

Re:Some DNS lookups causing 5xx errors due to leap second bug by lend000 on Sunday January 01, 2017 @01:35AM (#13294911)
Yes but even here, seconds since Epoch should remain unaltered, and the correction should be made by whatever is rendering a human readable date format (to address every leap second). In most cases, the renderer wouldn't have to address it (since it's only being read by humans, and a second difference does not usually matter) and it's truly a non-issue! The application-layer dev can choose to increment time in whatever blocks he wants instead of having an if-else chain for every "official" leap second. Like adding a minute every few hundred years, to that other commenter's point.
Re:Some DNS lookups causing 5xx errors due to leap second bug by samrolken on Sunday January 01, 2017 @01:44AM (#13294931)
Unfortunately, epoch time is not literally "seconds since epoch", at least not as implemented/standardized as "Unix time". It skips or repeats itself in case of leap seconds. So it can't save us here.

I think if there were such a thing as a different kind of epoch time that literally actually is "seconds since epoch" it would help a lot and work like you suggest.

Re:Some DNS lookups causing 5xx errors due to leap second bug by lend000 on Sunday January 01, 2017 @01:49AM (#13294943)
Yes, I agree -- I am not referring to any specific implementations. Didn't know that about Unix time, but it makes sense for compatibility given the current way we adjust for leap seconds.
Re:Some DNS lookups causing 5xx errors due to leap second bug by pycal on Sunday January 01, 2017 @12:07PM (#13296302)
Is this correct? Because I am having trouble understanding the rationale behind making the unix epoch relative to an earth solar year, as opposed to just the "number of seconds which have elapsed since the unix epoch". Do you have an example of this implementation? The Wikipedia article regarding epoch notes many counter-examples.
Re:Some DNS lookups causing 5xx errors due to leap second bug by zeta0134 on Sunday January 01, 2017 @01:30PM (#13296654)
The Wikipedia Article here, describing Unix Time, indicates precisely the issue. Unix time does not include leap seconds, which means that when a leap second occurs, the midnight transition to the next year needs to insert additional time. Strictly following the standard thus, the Unix timestamp rolls time backwards by one second over midnight, which is precisely the kind of behavior that breaks systems depending on continuous timestamps: https://en.wikipedia.org/wiki/Unix_time#Leap_seconds

It sounds like in your scenario, you would prefer Unix time to instead include the leap second, so that no rollback or time smearing behavior would need to occur. I believe the reason it does not has to do with simplicity: current systems rely on a day being 86,400 seconds, making each year (regardless of leap days) a multiple of 86,400. Leap seconds break this simple assumption. While it would be simple for a new time formatting system to take leap seconds into account, it is not so simple to go and retrofit all of the existing systems for a new formatting standard, and convince so many different groups of developers to change that much code while also agreeing with one another about the changes.

Re:Some DNS lookups causing 5xx errors due to leap second bug by swiley on Sunday January 01, 2017 @12:28AM (#13294795)
I wrote a WebDAV client the other year and dates where one of the hardest parts to implement because they expected them in calendar format! It seemed so odd to me that they would do that.
Re:Some DNS lookups causing 5xx errors due to leap second bug by stephenr on Sunday January 01, 2017 @12:56AM (#13294854)
Http/1.* headers are intended to be human readable
Re:Some DNS lookups causing 5xx errors due to leap second bug by wedesoft on Sunday January 01, 2017 @07:04AM (#13295505)
That one is called ephemeris time (ET). Astronomical applications require the information of the current difference UT-ET.
Re:Some DNS lookups causing 5xx errors due to leap second bug by nullc on Sunday January 01, 2017 @01:21AM (#13294891)
I believe those efforts could be better spent making systems more robust against other threats that can't be avoided by simply deciding to stop cutting ourselves.

Besides: Even expensive commercial time keeping devices frequently mishandle leap seconds. History suggests that we are underestimating how difficult they are to get right in complex systems.

Re:Some DNS lookups causing 5xx errors due to leap second bug by mark-r on Sunday January 01, 2017 @01:45AM (#13294935)
It's difficult to write bug-free code for events that happen very infrequently. Even more so when the distributed nature of the system makes effective testing under real-world conditions nearly impossible.
Re:Some DNS lookups causing 5xx errors due to leap second bug by greglindahl on Sunday January 01, 2017 @02:49AM (#13295027)
Yeah, that's exactly why Leap Day getting skipped every 4th year is such a disaster.
Re:Some DNS lookups causing 5xx errors due to leap second bug by macintux on Sunday January 01, 2017 @09:35AM (#13295838)
The ratio of embedded systems that care about the calendar to those that care about time has to be astronomical.
Re:Some DNS lookups causing 5xx errors due to leap second bug by alexbecker on Sunday January 01, 2017 @12:37AM (#13294814)
Maybe we should code systems with zero bugs. /s
Re:Some DNS lookups causing 5xx errors due to leap second bug by wyager on Sunday January 01, 2017 @12:44AM (#13294827)
Well, yeah, that's not a bad idea. It was kind of Dijkstra's whole thing. The problem is that, at current levels of technology, it's economically better to write cheap buggy software than more expensive bug-free software for almost all consumer applications. We are gradually pushing the optimality curve towards the provably bug-free end of the spectrum, but it will take time.
Re:Some DNS lookups causing 5xx errors due to leap second bug by recursive on Sunday January 01, 2017 @02:20PM (#13296842)
I thought we were pushing the optimality curve toward ever greater volumes of ever buggier code.
Re:Some DNS lookups causing 5xx errors due to leap second bug by Fnoord on Sunday January 01, 2017 @04:15AM (#13295199)
Glad TOTP refresh every 30 seconds, and are generally valid for at least 1 minute. One second less wouldn't make a large difference.
Re:Some DNS lookups causing 5xx errors due to leap second bug by guscost on Sunday January 01, 2017 @01:41AM (#13294929)
Someday when everyone switches to Rust we can have a standard library that handles all of this and software bugs will be obsolete ;)
Re:Some DNS lookups causing 5xx errors due to leap second bug by whyileft on Sunday January 01, 2017 @12:16AM (#13294771)
Or maybe we should start holding project managers accountable for these issues instead of simply basing their performance on deadlines.
Re:Some DNS lookups causing 5xx errors due to leap second bug by admax88q on Sunday January 01, 2017 @12:27AM (#13294789)
Classic Hacker News, it's always the PM or the management at fault, engineers are faultless.
Re:Some DNS lookups causing 5xx errors due to leap second bug by na85 on Sunday January 01, 2017 @12:36AM (#13294813)
I'd have time to develop a new toy programming language as a service alongside 3 new JavaScript frameworks in 2017 if it weren't for the evil PMs.
Re:Some DNS lookups causing 5xx errors due to leap second bug by craigvn on Sunday January 01, 2017 @04:29AM (#13295226)
;-) 98% of developers would be clueless to leap second issues. Hell, 50% struggle with leap years.
Re:Some DNS lookups causing 5xx errors due to leap second bug by whyileft on Sunday January 01, 2017 @01:27AM (#13294898)
> if you can’t measure it, you can’t manage it.