by hoytech · 4y ago · 0 comments
When the previous leap second was applied, a bunch of our Linux servers had kernel panics for some reason, so needless to say everyone was really concerned about a leap second happening during trading hours.
So I was assigned to make sure nothing bad would happen. I spent a month in the lab, simulating the leap second by fast forwarding clocks for all our different applications, testing different NTP implementations (I like chrony, for what it's worth). I had heaps of meetings with our partners trying to figure out what their plans were (they had none), and test what would happen if their clocks went backwards. I had to learn about how to install the leap seconds file into a bunch of software I never even knew existed, write various recovery scripts, and at one point was knee-deep in ntpd and Solaris kernel code.
After all that, the day before it was scheduled, the whole trading world agreed to halt the markets for 15 minutes before/after the leap second, so all my work was for nothing. I'm not sure what the moral is here, if there is one.
> He went away from the basement and left this note on his terminal: "I'm going to a commune in Vermont and will deal with no unit of time shorter than a season."
[0] https://en.m.wikipedia.org/wiki/The_Soul_of_a_New_Machine
With busy waiting, you can achieve timings in the sub-microsecond range, depending on how heavy the loop is.
Key words: constant TSC, invariant TSC, TSC clocksource
(i'm guessing that this was purely a joke and no such thing exists)
This is a euphemism. Please don't use it.
– Seemingly simple tasks can be more complex than you expect (“add a leap second on this Wednesday”)
– Real world systems can be more complex than you expect (“bunch of software I never even knew existed”)
– Planning and testing can make a big difference vs. just winging it (“a bunch of our Linux servers had kernel panics for some reason”)
– Success can be a non-event that goes unnoticed (”everything worked and no money went missing”)
– Sometimes the best solution is not a technical solution (“halt the markets for 15 minutes before/after”)
We've had an election recently, right on the day when DST changed. On the night of counting of the votes, the clock went 2:59 AM -> 2:00 AM.
To save themselves trouble the Statistics Office instructed all vote counters that under no circumstances are they to enter or update anything in any system during the repeating hour until it's 3:00 AM the second time…
Here, look. Using the time zone for Norway in this example, with the `date` command on macOS.
First the last second before DST ended in Norway this year.
TZ=Europe/Oslo date -I seconds -jf %s 1667091599
2022-10-30T02:59:59+02:00
Then the second after. TZ=Europe/Oslo date -I seconds -jf %s 1667091600
2022-10-30T02:00:00+01:00
So while people say that time went from 02:59:59 to 02:00:00, I see it as time going from 02:59:59+02:00 to 02:00:00+01:00 :)And for a lot of things problems would be solved with +01:00 offset while for others you actually want Europe/Berlin offsets
I once came across an early 1950s Scientific American article by Bertrand Russel, IIRC. It included a cartoon.
Frame one: Computer beats man at chess.
Frame two: Man unplugs computer.
And yet, there are still Y2K deniers (to be fair some people have exaggerated it to the point that they're promoting it as the end of the world).
I'm little confused. How does this solve the problem? If you don't code for the second, you'll still be off if you wait. I'm I missing something?
They had done it all the previous leap second during the weekend.
The hard part that required a lot of work was making sure that nothing breaks when it happens.
In this case they chose to have a mini weekend in the middle of the week for convenience
It always pays to not be the least-prepared among your cohort. You'll get no sympathy if you're at the back of the pack, you'll just die.
This is a hugely valuable learning experience few people even get a chance at, let alone solve. Too bad it doesn’t show up on your resume is the only downside!
Interview discussion? If you're any good at interviewing, it should.
...okay yeah that's not a moral, but still.
$work had thousands of full custom, dsp-heavy, location measurement hardware devices widely deployed in the field for UTDOA locating cell phones. It used GPS for time reference -- if you know your location, you can get GPS time accurate around the 10's of nanoseconds. GPS also broadcasts a periodic almanac which includes leap second offsets: if you wanted to apply the offset to GPS you could derive UTC. Anyway there were three models of these units, each with an off-the-shelf GPS chip from one of three location vendors you've probably heard of. The chip firmware was responsible for handling leaps.
One day, a leap second arrived from the heavens. We learned the three vendors all exhibited different behaviors! Some chips handled the leap fine. Some ignored it. Some just crashed, chip offline, no bueno, adios. And some went into a state that gave wildly wrong answers. After a flurry of log pulling, debugging, console cabling, and truck rolls, we had a procedure to identify units in bad states and reset them without too many getting bricked.
It seems the less likely an event is to occur, the less likely your vendor put work into handling it.
This recalls perhaps the biggest mistake in the GPS specification, the 1024-week rollover period. A timespan long enough to be impractical to test without expensive simulator hardware, short enough to be virtually guaranteed to cause problems in long-term installations... and long enough for OEMs to ignore with impunity. ("Eh, it's 20 years, by that time I'll be retired/dead/working somewhere else.")
Moral: timescale rollovers need to be designed to happen very frequently -- as in a few days at most -- or not at all. Unfortunately the leap second implementers didn't have that option.
> zero sum game of stock arbitrage.
By your definition insurance is zero sum as well. But people find that generally useful. Taking risk off of peoples hands has value even if a widget doesn’t come out the other end.
But why not just a reasonable product? Yes, what could that be, there cannot be something that is fairly priced and people really want, need, what just helps. Not today anymore!
> By your definition insurance
I know what you try there and on a very abstract level you are maybe slightly right, but PLEASE no, high level gambling (==milliseconds&millions) is not at all comparable to the insurance model in many regards, foremost maybe purpose for the community?
(and its pretty clear that fintech here sure doesn't mean the classical bank and modern "normal" payment system... ).
Yet when I go somewhere with no liquidity and a huge spread like a crypto exchange, a deeply unpopular corner of the stock derivatives market, or a Craigslist used stuff category, the wide spread is just a mild inconvenience at worst. You get to choose between waiting for a better deal and taking a worse deal immediately
A tight spread just means that somebody is getting rich by taking that choice away from me and everyone else on the exchange. It's not the most nefarious thing in the world, but it's not particularly helpful or altruistic either.
Despite the useful service of price discovery (here are so many better ways) it is clear from the EMH that those computers are not doing arbitrage, they are front running trades.
Illegal. Criminal in USA (I think). But makes billions and billions for the already very rich. So that is why there is so much of it
Idle curiosities can lead to their own waste, but the kernel panic was probably worth digging into earlier.
Apparently, its about as useful as the leap second itself ;)
I feel your pain though, as I've spent weeks on something only for it to be tossed away like it was nothing at the last second. I guess that's how Google devs feel when their projects are deprecated. At least theirs saw the light of day and provided some validation
It is clear to me that the disparity of latency creates islands of privilege. I mentioned this to someone in the industry once and they replied that what the layman perceives as parasitic middlemen actually provide valuable liquidity. When I asked whether they considered ticket-scalpers to likewise provide liquidity they claimed that was not at all the same thing.
I think the moral is that it'd be a lot easier if we could just stop messing with the clocks, or at least push more technical things towards only caring about a closest-to-a-global-high-precision-monotonic-clock-as-relativity-allows rather than worrying about what the clocks on the walls say, which is more a personal matter of how much you care or don't where the sun is in the sky at 12:00:00.000.
Edit: I guess the other way to look it is I guess now how much you can make on a few minutes of trading, seeing that it was worth putting at least one software engineer on it for a long time despite the risks...
As the CIA director in Burn After Reading says, "I guess we learned not to do it again."
So his work contributed to community wisdom, and that influential community has probably had some say in cancelling leap seconds. I wouldn't call his work wasted. I would call that notably few degrees-of-separation in making an observable difference.
Always procrastinate :-)
Sometimes the best (for some definition of best) solution to a problem is to side-step it entirely.
You're conscientious and willing to dig in to the details to fix a problem. Plenty of people aren't, and plenty of those are doing the same job as you. Look up from your own little world and try to figure out what other people are doing, how they're doing it, and why. This applies generally: If you fixate on a specific language or toolkit, you'll miss others which fix or obviate bugs you were resigned to living with. Same with OSes and environments. It even applies to relationships, which is why a big hallmark of abuse is isolating the victim.
Do you mean at your desk? What is a lab in a fintech context?