Click here to show or hide the menubar.

A mess in urlShortenerLand


There's a bug in the responder that shows up after the day change. Should have seen it coming, but I didn't. Now there's a mess to clean up on every server that's running urlShortener.root.

The problem was that it was calling initName on the table in the responder. It looks in the current day's table, if it finds the name table, great, it just makes sure that it has all the bits it's supposed to. But if it isn't there, it creates one.

But what if the table exists, it just wasn't created today? Too bad, there's now a newer table with the same name. And when there's a lookup, that's the one it finds. Unfortunately it's a table without a longUrl in it. So the responder sends you to the empty string. Which isn't a place. Hence breakage.

The fix is to: 1. Stop calling initName in the responder. 2. Delete all the tables that were created this way (they are identified by having a longUrl entry that is empty).

Parts

urlShortenerSuite.utilities.cleanupAfterOvernightBug

urlShortenerSuite.responder.respond

urlShortenerSuite.background.everyMinute


Posted on Wednesday, March 07, 2012 at 8:25 AM by Dave Winer.