No problem -- thanks for the thoughtful review!

One point. I wasn't sure how the "else" clause worked, so I just tested it out locally.  Seems that the "else" will get called only if there is no exception at all, whereas "finally" will always be called.  So if the _update_subtask_status() call in the try-clause raised a non-DatabaseError exception, an else-clause would not be called and the lock would not be released.  So the "else" is *really* for stuff you would otherwise put in a try-clause, not stuff you would put into a finally clause.