Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Bug Cloud Microsoft IT

Azure Failure Was a Leap Year Glitch 247

judgecorp writes "Microsoft's Windows Azure cloud service was down much of yesterday, and the cause was a leap year bug as the service failed to handle the 29th day of February. Faults propagated making this a severe outage for many customers, including the UK Government's recently launched G-cloud service."
This discussion has been archived. No new comments can be posted.

Azure Failure Was a Leap Year Glitch

Comments Filter:
  • by madsci1016 ( 1111233 ) on Thursday March 01, 2012 @11:37AM (#39208969) Homepage
    Anyone remember trying to turn on their Zune 3.5 years ago? [slashdot.org] That didn't work so well either.
  • Prepared for future (Score:4, Informative)

    by gmuslera ( 3436 ) * on Thursday March 01, 2012 @11:39AM (#39209011) Homepage Journal
    If they can't handle an exception that is around since 2k years ago, what about newer exception? Would be interesting to see what could happen next June 30.
  • by Bruce Perens ( 3872 ) <bruce@perens.com> on Thursday March 01, 2012 @12:10PM (#39209561) Homepage Journal
    30 years ago, Arthur David Olson started engineering a solution to this problem that persists to this day, and which he supported personally for all but the last few months. The systems I have that run his software have never even burped through legislative changes of the calendar, leap-seconds, and the Century leap-year day, which is a separate cycle from the 4-year one.
  • by Kozz ( 7764 ) on Thursday March 01, 2012 @12:14PM (#39209635)

    Now, I'm not necessarily a Microsoft apologist, but I have to point out that it wasn't so long ago that other things near and dear to us geeks were experiencing similar problems.

    I was trying to run some ant scripts yesterday that interact with an FTP server to delete some files. Those damned files wouldn't get deleted. They weren't even returned from a listing command. As it turns out, I was using a particularly old version of Apache Commons-Net library (this jar file was from 2005) which had a leap-year bug. It simply would not show me files with modification dates of 2/29. I was looking at the FTP server configuration, logging in with other clients, moving and renaming files, and all about ready to break out Wireshark... and then it occurred to me that it was leap day. Hoo-fucking-ray. "touch"ed the file, and sure enough, it was suddenly available. Those are a few hours of my life I'll never get back.

  • by tillerman35 ( 763054 ) on Thursday March 01, 2012 @12:29PM (#39209943)

    Some of the common leap year bugs that I've seen over the years:

    1. A matrix with the number of days per month:
    e.g. smallint dayspermonth[12]={31,28,31,30,31,30,31,31,30,31,30,31};
    Indexing into the matrix for February (index 1) ignores leap years.

    1. A matrix with 365 elements to represent a year's worth of something:
    e.g. smallint hightemps[365];
    This usually doesn't fail until Dec 31, when hightemp[mydate.dayofyear()-1] points to a non-existent element.
    Of course, if dayofyear is calculated using the matrix in the prior bug, it will fail invisibly since that will be incorrect
    as well.

    2. Quck-n-dirty subtract one year math:
    e.g. Convert date to char in YYYYDDMM format, convert char to int, subtract 10000, convert back to a char and then date.
    Why people do this when you can dateadd(year,mydate,-1) is that easy, I have no clue. But it breaks horridly when
    you use it to determine "one year ago today" from Feb 29.

  • by SuricouRaven ( 1897204 ) on Thursday March 01, 2012 @01:09PM (#39210561)
    The leap year specification was only written in 1582. So it isn't 2k years old.
  • by tlhIngan ( 30335 ) <[ten.frow] [ta] [todhsals]> on Thursday March 01, 2012 @01:27PM (#39210859)

    No it came from Freescale in a driver that Toshiba used. Not many know that the original Zune was a Toshiba Gigabeat with a new UI and outer shell.

    Yeah, it was a really stupid bug, especially when you consider the OS provides a very useful set of APIs for dealing with it (basically convert a SYSTEMTIME (day/month/year/mm/hh/ss) into a FILETIME (64-bit unsigned int similar to time_t), do your math (the compiler will handle the 64-bit computations for you) and convert it back. Two OS calls.

    If you're having ot do leap year calculations or even any sort of date calculations, stop. The OS or library will probably already have a set of functions for doing date calculations without you have to do it manually. Given how easy they are to screw up, far better to leave it to someone else.

    Hell, given Windows worked fine, I don't even want to know what Azure is doing - the fundamental OS and runtimes all handle leap year date calculations with aplomb. Heck, that might be some of the oldest code in the kernel these days because it was written a long time ago, works well and has been thoroughly debugged through the decades.

  • by Anonymous Coward on Thursday March 01, 2012 @06:32PM (#39215085)

    And then you get hosed every 100... except when it's every 400.

    No, that's a feature that the Gregorian calendar added later.

    The simple Julian calendar assumed that years were exactly 365.25 days long and had a leap day every four years starting from 46 BC.

    gmuslera was right --- leap days have been around for over 2000 years.

8 Catfish = 1 Octo-puss

Working...