Mark Sapiro writes:
add_member saves the list with the first member.
VirginRunner gets there first, instantiates and caches the list. It then locks the list, processes the welcome and saves and unlocks the list.
add_member gets the lock, adds the second member and saves the list.
Virgin runner gets the second welcome. The list is cached, so it uses the cached instance. It then locks the list which ultimately calls MailList.__load() to refresh the list data, but __load() does
mtime = os.path.getmtime(dbfile) if mtime <= self.__timestamp: # File is not newer return None, None
Shouldn't "mtime < self.__timestamp" do the right thing (much more often)? You're still vulnerable to "date -s", adjtime, and friends, though, and of course you'll have some undesirable cache misses at times when it would be nice if you didn't.
A better way would be to add a serial number.