Reminder to self

I’ve been work­ing on get­ting my com­pa­ny’s web­site’s cred­it card proces­sor upgrad­ed to talk to mul­ti­ple trans­ac­tion ser­vices providers so that our cus­tomers can choose their own damn cred­it card proces­sors and still work with us. I’d hoped to get this fin­ished last week, and I left work Fri­day night at 5:30 think­ing, «just a cou­ple hours on Mon­day and it’ll be all done.» Well, I left Mon­day night and Tues­day night think­ing I had only a cou­ple hours left before I could start final test­ing. Well, we’re sup­posed to go live with this damn thing today and it’s not fin­ished, so yeah, I’m blow­ing right past a major deadline.

Last night I did­n’t leave at 5:30. I had a major glitch on my hands and I could not find the cause of it. Basi­cal­ly, for some rea­son the HTTP head­ers on the pages were com­ing up all screwy—I’m not con­ver­sant enough in HTTP head­ers to accuse them of being mal­formed, but they had a lot more infor­ma­tion than they should have, and so the pages were dis­play­ing a bunch of gar­beldy­gook at the top of the page. Lists of Apache mod­ules installed on the serv­er, stuff like that.

I had nar­rowed the prob­lem down to a sin­gle sub­rou­tine, and I com­ment­ed out sec­tions and oth­er sec­tions to see where it might be. The more I looked, the more con­fused I got. I could­n’t nar­row the prob­lem down and noth­ing looked like it should affect head­ers that get sent to the brows­er before the page gets sent. I was frus­trat­ed and just stuck to it, want­i­ng to wres­tle the code into submission.

Final­ly at 9:45 I made a phone call to some­one smarter than myself (The Com­pul­sive Spon­sor), who told me in no uncer­tain terms, to get the hell out of the office. It was an exam­ple of know­ing what my spon­sor would tell me, but need­ing to hear the words. I guess part­ly that’s me not want­i­ng to take respon­si­bil­i­ty for leav­ing my post. Well, I did. I stopped off to a 10pm meet­ing at the Mari­na Dock (a lot of peo­ple gripe about the Dock, but I’m damn glad it exists so that I can grab a meet­ing at almost all hours) because I was so frus­trat­ed. It was after mid­night before I got home and Ozzy was cry­ing to be fed. I’d for­got­ten to get cat food on the way home, so I had to go back out to the gro­cery store. It was after 2:30 when I got to bed. My alarm was set for 5:00.

I actu­al­ly slept in until 6:30am and came right on in to the office because I did­n’t know how much trou­ble this code would be. Ran into dra­cun­cu­lus in the BART sta­tion which was pleas­ant except for the awk­ward­ness of try­ing to make small talk with a fried brain and a min­i­mum of sleep. I got in to the office at 8:15 and…

.…ate a muf­fin, drank a dou­ble-shot depth charge and solved the bug by 8:45.

What was the bug? My bad. Improp­er­ly scoped vari­ables with the same name. $status in one rou­tine was being set to ‑1 and the rou­tine that selects which http head­er to send out also uses $status. Instead of send­ing out Sta­tus 500 (or 404 or what­ev­er) the serv­er was try­ing to serve up http sta­tus ‑1. Nice. I had to add the key­word my to the vari­able dec­la­ra­tion in each rou­tine, which I should have done in the first place anyway.

Oh, I guess I do know enough about http head­ers to know that’s malformed.

But the les­son is: don’t stay late work­ing when try­ing to get through a sticky prob­lem. I knew that any­way, but it bears repeat­ing because I’m sort of dense that way.

In any case, I now have a lot of work to do to catch up. Yay fun!

There is so much more from the last 24 hours, big news, more death, but I just can’t get into it now.

Leave a Reply