-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Aug 5, 2008, at 9:08 PM, Stephen J. Turnbull wrote:

Mark Sapiro writes:

1) add_member saves the list with the first member.
2) VirginRunner gets there first, instantiates and caches the list.
  It then locks the list, processes the welcome and saves and unlocks
  the list.
3) add_member gets the lock, adds the second member and saves the list.
4) 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.

Probably so, but is the optimization still worth it?

A better way would be to add a serial number.

You'd probably want to store the serial number in the file name so you wouldn't have to load the pickle just to get the current serial. It's similar to what happens with the queue files. But again, I'm not sure it's worth it.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkiY+ygACgkQ2YZpQepbvXHdBwCfZRO73w4KiA0FMg6eU3yDU8YN
Y7AAoLE5760wZWw536oMj1zyHMNi8h4a
=w1PV
-----END PGP SIGNATURE-----
_______________________________________________
Mailman-Developers mailing list
Mailman-Developers@python.org
http://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9

Reply via email to