• Barry Warsaw's avatar
    Fixes to close a pack-related race condition. If new objects were · e49710b4
    Barry Warsaw authored
    added while a pack was stuck between a mark and a sweep, the mark
    would not have found the new objects as root reachable (because they
    wouldn't have been stored yet), but the sweep will find then and
    erroneously delete them.
    
    _setupDBs(): Add a _packing flag which gets set whenever we're doing a
    classic or auto pack
    
    _docommit(): When the _packing flag is set, copy all oids in the _oids
    table to the _packmark table, so any objects added between the mark
    and sweep phases will not be gc'd.  This is fine because if they're
    still not root reachable by the next gc pass, they'll get collected
    then.
    
    pack(): Set and reset the _packing flag around the calls to _dopack().
    
    Also, get ZERO from the package, and add the `info' table for storage
    metadata.
    
    _docommit(): Fix a reference counting bug caused by not incref'ing the
    objects referred to by the new pickle of a new object revision.
    e49710b4
BDBMinimalStorage.py 22.6 KB