Tuesday, August 26, 2008

Broken ETags in the Wild

I've had a good teacher. Just noting some of the things I've come across.

Default Apache httpd configuration in a cluster with multiple filesystems

By default, Apache httpd generates an ETag of the format inode-filesize-timestamp. A symptom of this sort of physical architecture is seeing ETags for the same resource and representation that have the same last part; e.g. "518854-3504d-ce290380" and "c8578-3504d-ce290380", and probably the same Last-Modified value too. This can be fixed by changing the Apache configuration or ignoring the ETag and just using Last-Modified. I would normally recommend retaining the ETag and just using the MTime and Size parts to calculate the ETag value.

EScenic CMS

I'm not sure whether this is an application developer issue, or a problem with the EScenic server itself, but the ETag values that I've seen from this server aren't quoted.

Etag: 20080523124147BST-39-6

The ETag value should be a quoted string


Django on Google App Engine 1.0

The version of Django 0.96.1 that shipped with Google App Engine had a similar problem to the EScenic Server, so I'd recommend bundling Django with your app until Google update the bundled version. I went to fix this in Django trunk, only to find someone beat me to it!

Cameron

Something happened earlier this year and I'm only now comfortable enough to able to talk about it. It happened on 22nd June. At the time, it was terrifying, but it has a good ending.

Al had gone away for the weekend and I was at home playing single parent. Sunday morning, not quite woken from my reverie by Cameron crying softly, I got up, changed his nappy then put him on the floor in his room to play. Connor started calling to get me to come help him on the toilet. I left Cameron's room, pulled the stairgate shut and went to the bathroom to help Connor, rubbing the sleep from my eyes. About 10 seconds later I heard the worst sound that I've ever heard. A soft thudding as the boy went down the stairs, followed by immediate screaming. Fuck. I raced down to find a scene from a Tarantino film. I don't know whether the detachment comes from my (long expired) medical training, or that's just what people naturally do in these situations. I noted the pools of blood on the Mediterranean-tiled floor. Then the bump on his forehead where the blood was coming from, as I cradled him. "That's a strange looking bump, more of an indentation. Oh, that's his skull." Reaching for a muslin to try to apply pressure to the wound. It was too wide really anyway to allow effective compression, so I tried to pack the wound while talking to the emergency services operator. It was very hard to hear them with my own state and Cameron either in pain or understandably upset. Got the other two to dress themselves while the ambulance came and I got some clothes on and mopped up the blood. A big part of me even at that point was worrying Al'll kill me if she sees this, and I didn't want his brothers to see all the blood.

The ambulance came and we all piled in. Callum and Connor were thrilled to be in the van with the sirens going off. I was probably white as and trying to speak calmly to Cameron as they strapped me on the bed and we moved swiftly to Frimley Park. The ambulance crew were great and we got there, Cameron having thrown up on the journey and coming close to closing his eyes a few times.

A&E was very quiet. Lots of fabulous nursing staff were there, and able to take some of the load in terms of getting out toys for the other two boys and Cameron showed an interest as well. Then I could phone Al at her hotel on the hen-weekend and relay the bad news. She took it as well as could be expected and we had lots of crying phone calls as she was driven from Bath to get to the hospital. Due to the lack of urgency in how we were being treated, I was getting more confident at this point that it wasn't life-threatening. By this time, it was the boy's nap time and the nursing staff were happy enough that he could go to sleep. Al arrived maybe 15 minutes after he went to sleep and came into the ward to see him sleeping with his eyes open, head lolling back in my arms and a cut wider maybe a centimetre wide and 6 centimetres long on his forehead, with the bone showing through. It looked ghastly and we were both crying again. We had some fraught communication with the Reg / SHO about where the best place for treatment was. Doubtless that wasn't helped by our frame of mind, and the language issue with the guy. But we were immensely happy with the level of treatment and service that the emergency services provide. You only really miss something when you don't have it anymore; I don't ever want to experience that loss with our primary medical care.

Due to the nature of the head injury, Cameron was kept in overnight for observation. Our friends Alan and Alison provided invaluable help in taking the two older boys with them to a rowing regatta where they got spoiled on BBQ and ice-creams until I went to pick them up later. As an indicator of where my head was, I picked them up and promptly drove the wrong way around a roundabout. Fortunately the guy coming the other way was going fairly slowly, then my brain kicked in and I recognised where I was. Al phoned later with the results of the CT scan (she's very persuasive!).

Cameron and Al were transferred to St George's Tooting to go to the Maxillo Facial surgical unit, where Dr Singh did an amazing job of closing him up. We got to take him home the same day.

We examined the stairgate. It is a retractable one, which clips onto the opposing wall at the top and the bottom. The top clip was on a block screwed into the wall. I had placed the block 4 years earlier, which had then been removed and replaced by the painter, and endured some abuse from the other two swinging on it. We saw that it was fairly easy to just clip the gate on the top alone, without clipping the attachment on the skirting board as well. When set like this, effectively it acted like a catflap and Cameron would have had hardly any resistance to crawling against it. Not ensuring that this was properly attached was completely my fault. We were so lucky with how this turned out; from the blood pattern it looked like he'd surfed on his stomach down the first 5 steps and hit the skirting board with his head. From there, he'd rolled down the rest of the stairs to the tiled floor below, but somehow not done further damage to himself when he got to the tiles. Then the first order was shooting some video so that both sets of grandparents could see the extent of the damage and be assuaged that they didn't need to travel down to see him straight away.



So lucky, and so blessed.

Facebook Mega-Data

Just noticed that Facebook open-sourced a version of their BigTable data store and it's hosted on Google code, written in Java. I'll omit the obvious snickers about Facebook cloning BigTable and then hosting on Google Code.