News for hackers. Stuff that matters.
Re:Deep dive into the UK air traffic control meltdown by raverbashing on Monday September 11, 2023 @02:51PM (#37471897)
And that's why I never (or very rarely) put "this should never happen" exceptions anymore in my code

Because you eventually figure out that, yes, it does happen

Re:Deep dive into the UK air traffic control meltdown by airstrike on Monday September 11, 2023 @03:52PM (#37472705)
This here is the true takeaway. The bar for writing "this should never happen" code must be set so impossibly high that it might as well be translated into "'this should never happen' should never happen"
Re:Deep dive into the UK air traffic control meltdown by andrewaylett on Monday September 11, 2023 @05:17PM (#37473846)
The problem with that is that most programming languages aren't sufficiently expressive to be able to recognise that, say, only a subset of switch cases are actually valid, the others having been already ruled out. It's sometimes possible to re-architect to avoid many of this kind of issue, but not always.

What you're often led to is "if this happens, there's a bug in the code elsewhere" code. It's really hard to know what to do in that situation, other than terminate whatever unit of work you were trying to complete: the only thing you know for sure is that the software doesn't accurately model reality.

In this story, there obviously was a bug in the code. And the broken algorithm shouldn't have passed review. But even so, the safety critical aspect of the complete system wasn't compromised, and that part worked as specified -- I suspect the system behaviour under error conditions was mandated, and I dread to think what might have happened if the developers (the company, not individuals) were allowed to actually assume errors wouldn't happen and let the system continue unchecked.

Re:Deep dive into the UK air traffic control meltdown by pmontra on Monday September 11, 2023 @04:10PM (#37472957)
A customer of mine is adamant in their resolve to log errors, retry a few times, give up and go on with the next item to process.

That would have grounded only the plane with the flight plan that the UK system could not process.

Still a bug but with less effects to all the continent, because planes that could not get inside or outside the UK could not fly and that affected all of Europe and possibly more.

Re:Deep dive into the UK air traffic control meltdown by crabbone on Monday September 11, 2023 @05:37PM (#37474062)
> That would have grounded only the plane with the flight plan that the UK system could not process.

By the looks of it, it was few hours in the air by the time the system had a breakdown. Considering it didn't know what the problem was, it seems appropriate that it shut down. No planes collided, so the worst didn't happen.

Re:Deep dive into the UK air traffic control meltdown by pmontra on Tuesday September 12, 2023 @03:55AM (#37478006)
Couldn't the outcome be "access to the UK airspace denied" only for that flight? It would have checked with an ATC and possibly landed somewhere before approaching the UK.

In the case of a problem with all flights, the outcome would have been the same they eventually had.

Of course I have no idea if that would be a reasonable failure mode.

Re:Deep dive into the UK air traffic control meltdown by PeterStuer on Monday September 11, 2023 @04:40PM (#37473394)
So what does your code do when you did not handle the this should never happen exception? Exit and print out a stacktrace to stdout?