Live data from Hacker News

A single line of code cost $8000

pietrasiak.com

31–40 of 423 posts

Re: A single line of code cost $8000

#31
> While refactoring it, I forgot to add the code to stop the 5-minute interval after the new version file was available and downloaded.

I’m sorry but it’s exactly cases like these that should be covered by some kind of test, especially When diving into a refactor. Admittedly it’s nice to hear people share their mistakes and horror stories, I would get some stick for this at work.

Re: A single line of code cost $8000

#32
post #22
post #11

I would also put into question if you _really_ need to check for updates every 5 minutes. Once per startup is already enough, and if you're concerned about users who leave it on for days, it could easily be daily or even less often.

A 5 minute update check interval is usage-reporting in disguise. Way fewer people would turn off a setting labeled “check for updates” than one labeled “report usage statistics”.

Do they say that they don't do any usage reporting?

Re: A single line of code cost $8000

#33

> We decided to take responsibility and offer to cover all the costs related to this situation. Good on them. Most companies would cap their responsibility at a refund of their own service's fees, which is understandable as you can't really predict costs incurred by those using your service, but this is going above and beyond and it's great to see.

"Luckily, it was not needed"

Re: A single line of code cost $8000

#35
post #22
post #11

I would also put into question if you _really_ need to check for updates every 5 minutes. Once per startup is already enough, and if you're concerned about users who leave it on for days, it could easily be daily or even less often.

A 5 minute update check interval is usage-reporting in disguise. Way fewer people would turn off a setting labeled “check for updates” than one labeled “report usage statistics”.

Don’t give them ideas!!

Re: A single line of code cost $8000

#38
I assume most of that 2PB network traffic was not egress, right? Otherwise how did it "only" cost you $8k on Google Cloud? Even at a cost of 0.02$ per GB, which is usually a few times lower than the actual prices I could find there, that would still result in an invoice of about $40k...

Re: A single line of code cost $8000

#39
These articles are great, but I have to one-up the blog: I recently helped a small dev team clean up a one-line mistake that cost them $95,000... which they didn't notice for three months.

The relevance is that instead of checking for a change every 5 minutes, the delay wasn't working at all, so the check ran as fast as possible in a tight loop. This was between a server and a blob storage account, so there was no network bottleneck to slow things down either.

It turns out that if you read a few megabytes 1,000 times per second all day, every day, those fractions of a cent per request are going to add up!

Re: A single line of code cost $8000

#40
>Add special signals you can change on your server, which the app will understand, such as a forced update that will install without asking the user.

I understand the reasoning, but that makes it feel a bit too close to a C&C server for my liking. If the update server ever gets compromised, I imagine this could increase the damage done drastically.

Post reply on HN