Why HN was down
1049 pointsOn a comment thread, a new user had posted some replies as siblings
instead of children. I posted a comment explaining how HN worked.
But then I decided to just fix it for him by doing some surgery in
the repl. Unfortunately I used the wrong id for one of the comments
and created a loop in the comment tree; I caused an item to be its
own grandchild. After which, when anyone tried to view the thread,
the server would try to generate an infinitely long page. The
story in question was on the frontpage, so this happened a lot.
For some reason I didn't check the comments after the surgery to
see if they were in the right place. I must have been distracted
by something. So I didn't notice anything was wrong till a bit
later when the server seemed to be swamped.
When I tailed the logs to see what was going on, the pattern looked
a lot like what happens when HN runs short of memory and starts
GCing too much. Whether it was that or something else, such problems
can usually be fixed by restarting HN. So that's what I did. But
first, since I had been writing code that day, I pushed the latest
version to the server. As long as I was going to have to restart
HN, I might as well get a fresh version.
After I restarted HN, the problem was still there. So I guessed
the problem must be due to something in the code I'd written that
day, and tried reverting to the previous version, and restarting the
server again. But the problem was still there. Then we (because
by this point I'd managed to get hold of Nick Sivo, YC's hacker in
residence) tried reverting to the version of HN that was on the old
server, and that didn't work either. We knew that code had worked
fine, so we figured the problem must be with the new server. So
we tried to switch back to the old server. I don't know if Nick
succeeded, because in the middle of this I gave up and went to bed.
When I woke up this morning, Rtm had HN running on the new server.
The bad thread was still there, but it had been pushed off the
frontpage by newer stuff. So HN as a whole wasn't dying, but there
were still signs something was amiss, e.g. that /threads?id=pg
didn't work, because of the comment I made on the thread with the
loop in it.
Eventually Rtm noticed that the problem seemed to be related to a
certain item id. When I looked at the item on disk I realized what
must have happened.
So I did some more surgery in the repl, this time more carefully,
and everything seems fine now.
Sorry about that.
Comments (287) 94 threads
Show all comments
Showing thread 5 of 94
Credit to PG, RTM and the rest of the team for keeping the sites uptime as high at it is.
Who were they going to blame?
Or he could have just dodged the blame entirely.
This guy actually called bugfixes "optimizations": "hey, X the feedback widget on the front page isn't working", "oh, yeah, I haven't worked on that because that's code that needs to be 'optimized', so it's low on my issues list". Ugh.
I've learned my lesson now. In fact, that's an incredible lesson for a startup founder: never, ever, hire someone who dodges a question on an interview. And the first time they avoid taking responsibility for something that was clearly their fault, fire them. The last thing you want is someone who'll blame everyone and anything else for their issues. It's a great way to kill morale and create rifts in a small team.
I guess there's still difficult for a lot of people to acknowledge their own mistakes, maybe because they're afraid of getting fired for that (acknowledging the mistake), which in the case of startups/small companies happens very rarely.
From my own experience of working at startups for my entire professional career as a programmer (7 and a half years) I can tell you that the first step when noticing you f.cked something up is to take immediate responsibility and then asking yourself "how can I/we fix this?" (you might need the help of other people to fix your mistake). After you've fixed the issue the question should be "how can we make so that this doesn't happen again?". That being solved I'd say nobody cares anymore whose fault was it to begin with, there's always other more important stuff to do.
I agree that maybe at larger companies this kind of thing might happen exactly the opposite way, i.e. you can get fired for making a mistake and nobody really cares to fix other people's stuff, because their next paycheck/financial well-being does not depend on that (or so they think).
I think in this guy's case the causes for his reluctance (or rather, incapability) to accept his own mistakes had much deeper roots. He was literally the most self-centered person I've ever met, to the point that he wouldn't accept anyone's opinion on anything. He went out of his way to find doctors that'd go with his suggestions and run all kinds of tests on him to determine why he had a blood pressure problem, when he was clearly way overweight and had the unhealthiest diet I've ever seen. He'd dress up in shorts and t-shirts during the worst days of winter, and then take a niacin pill to force a capillary rush so his hands wouldn't feel cold (?)
Basically, he just thought the world had to bend to his will. Why use common sense, when you can just say "fuck it" and find a workaround that fits your mindset. Of course you can't expect someone like that to 'accept' his own shortcomings.
The scariest part of all this is he tried, for a while, to become a cop. Yep, imagine that: a 240lbs armed prick, completely unable to reason, forcing his way on everyone. I shudder at the thought.
Continue this thread — 1 reply