• Jeremy Hylton's avatar
    Prevent client from using stale cache data while connecting. · b25c2295
    Jeremy Hylton authored
    XXX Maybe there should be an option to allow this.
    
    A ZEO client can run in disconnected mode, using data from
    its cache, or in connected mode.  Several instance variables
    are related to whether the client is connected.
    
    _server: All method calls are invoked through the server
       stub.  When not connect, set to disconnected_stub an
       object that raises ClientDisconnected errors.
    
    _ready: A threading Event that is set only if _server
       is set to a real stub.
    
    _connection: The current zrpc connection or None.
    
    _connection is set as soon as a connection is established,
    but _server is set only after cache verification has finished
    and clients can safely use the server.  _pending_server holds
    a server stub while it is being verified.
    
    Before this change, a client could start using a connection before
    verification finished.  If verification took a long time, it could
    even commit a new transaction using a mixing of old and new data.
    b25c2295
ClientStorage.py 35.1 KB