An error occurred fetching the project authors.
  1. 26 Sep, 2002 1 commit
  2. 20 Sep, 2002 1 commit
    • Guido van Rossum's avatar
      I set out making wait=1 work for fallback connections, i.e. the · 24afe7ac
      Guido van Rossum authored
      ClientStorage constructor called with both wait=1 and
      read_only_fallback=1 should return, indicating its readiness, when a
      read-only connection was made.  This is done by calling
      connect(sync=1).  Previously this waited for the ConnectThread to
      finish, but that thread doesn't finish until it's made a read-write
      connection, so a different mechanism is needed.
      
      I ended up doing a major overhaul of the interfaces between
      ClientStorage, ConnectionManager, ConnectThread/ConnectWrapper, and
      even ManagedConnection.  Changes:
      
      ClientStorage.py:
      
        ClientStorage:
      
        - testConnection() now returns just the preferred flag; stubs are
          cheap and I like to have the notifyConnected() signature be the
          same for clients and servers.
      
        - notifyConnected() now takes a connection (to match the signature
          of this method in StorageServer), and creates a new stub.  It also
          takes care of the reconnect business if the client was already
          connected, rather than the ClientManager.  It stores the
          connection as self._connection so it can close the previous one.
          This is also reset by notifyDisconnected().
      
      zrpc/client.py:
      
        ConnectionManager:
      
        - Changed self.thread_lock into a condition variable.  It now also
          protects self.connection.  The condition is notified when
          self.connection is set to a non-None value in connect_done();
          connect(sync=1) waits for it.  The self.connected variable is no
          more; we test "self.connection is not None" instead.
      
        - Tried to made close() reentrant.  (There's a trick: you can't set
          self.connection to None, conn.close() ends up calling close_conn()
          which does this.)
      
        - Renamed notify_closed() to close_conn(), for symmetry with the
          StorageServer API.
      
        - Added an is_connected() method so ConnectThread.try_connect()
          doesn't have to dig inside the manager's guts to find out if the
          manager is connected (important for the disposition of fallback
          wrappers).
      
        ConnectThread and ConnectWrapper:
      
        - Follow above changes in the ClientStorage and ConnectionManager
          APIs: don't close the manager's connection when reconnecting, but
          leave that up to notifyConnected(); ConnectWrapper no longer
          manages the stub.
      
        - ConnectWrapper sets self.sock to None once it's created a
          ManagedConnection -- from there on the connection is is charge of
          closing the socket.
      
      zrpc/connection.py:
      
        ManagedServerConnection:
      
        - Changed the order in which close() calls things; super_close()
          should be last.
      
        ManagedConnection:
      
        - Ditto, and call the manager's close_conn() instead of
          notify_closed().
      
      tests/testZEO.py:
      
        - In checkReconnectSwitch(), we can now open the client storage with
          wait=1 and read_only_fallback=1.
      24afe7ac
  3. 19 Sep, 2002 1 commit
  4. 17 Sep, 2002 8 commits
  5. 15 Sep, 2002 1 commit
    • Guido van Rossum's avatar
      Fix argument passing to the storage factory in winserver. · 207efabe
      Guido van Rossum authored
      This code used to assume that all arguments were strings.
      It was always wrong (create was passed as '0' or '1' rather
      than as 0 or 1) but this was somehow masked.  When I added
      readonly, things broke.  The solution is that winserver.py
      ha a convention that an argument starting with '=' is
      evaluated as an expression, and _startserver in testZEO's
      WindowsConnectionText uses this for the create and readonly
      args.
      207efabe
  6. 13 Sep, 2002 1 commit
    • Guido van Rossum's avatar
      Import Disconnected from the correct module. · 8b3a867c
      Guido van Rossum authored
      Add a LOG call to ConnectionTests.setUp().
      
      Add tests for the ClientStorage read_only and read_only_fallback
      features.  Note that the latter feature is not completely working yet;
      the reconnect feature doesn't work, so it's of questionable value for
      now (though it *does* connect to a read-only storage whe no read-write
      storage is available).
      8b3a867c
  7. 12 Sep, 2002 3 commits
  8. 05 Sep, 2002 1 commit
  9. 29 Aug, 2002 1 commit
  10. 28 Aug, 2002 1 commit
    • Guido van Rossum's avatar
      Another bunch of small cleanups and fixes. · 695f2ef4
      Guido van Rossum authored
      Open the cache later to avoid scanning it twice if a connection is
      made right away.
      
      ClientStorage.close() is now idempotent.
      
      ClientStorage stores its addr argument as self._addr so the test suite
      doesn't have to dig it out of the rpc manager to reopen the storage as
      readonly.
      
      Renamed some of the callbacks into the client for clarity:
      begin -> beginVerify
      end -> endVerify
      invalidate -> invalidateVerify
      Invalidate -> invalidateTrans
      695f2ef4
  11. 22 Aug, 2002 1 commit
  12. 14 Aug, 2002 2 commits
  13. 08 Aug, 2002 1 commit
    • Jeremy Hylton's avatar
      Refactor test cleanup to use removefs() helper function. · 46d79eae
      Jeremy Hylton authored
      StorageTestBase.removefs() will attempt to remove files with all the
      possible extensions that FileStorage will create.  It will raise
      os.error for any error except ENOENT.
      
      Remove many variants of removefs() implemented in the various test
      suites.
      46d79eae
  14. 11 Jun, 2002 1 commit
  15. 04 Apr, 2002 2 commits
  16. 15 Mar, 2002 1 commit
  17. 12 Feb, 2002 1 commit
  18. 25 Jan, 2002 1 commit
  19. 24 Jan, 2002 1 commit
  20. 21 Jan, 2002 2 commits
  21. 02 Nov, 2001 1 commit
  22. 04 Oct, 2001 1 commit
  23. 07 Sep, 2001 1 commit
  24. 24 Aug, 2001 1 commit
  25. 23 Aug, 2001 1 commit
  26. 17 Aug, 2001 1 commit
    • Jeremy Hylton's avatar
      Update ZEO connection tests to run on Windows · c67fd0f1
      Jeremy Hylton authored
      forker.py:
          Extend start_zeo_server() on Windows with arg that specifies port,
          which is used to restart the server on the same port.
      
          Remove unnecessary imports.
      
          Set PYTHONPATH for the spawned script.
      
      testZEO.py:
          Refactor ConnectionTests into abstract base class with two platform-
          specific subclasses.
      
          Add goofy test_suite() function, which is goofy because I can't figure
          out how to use unittest any other way.
      
      winserver.py:
          Keep track of storage in ZEOTestServer so that its close() method can be
          called when the server exits.
      c67fd0f1
  27. 16 Aug, 2001 1 commit
    • Jeremy Hylton's avatar
      Add rudiments of a ZEO test framework for Windows · 0be6d6ea
      Jeremy Hylton authored
      winserver.py: A small script that runs a ZEO StorageServer and a ZEOTestServer.
          The ZEOTestServer is used to kill the StorageServer during a unit test's
          teardown phases.  As soon as a client connects to that server, it exits
          the process.
      
      forker.py: Now forks and spawns, depending on os.
          XXX This needs to be cleaned up a lot, since the interfaces on Windows and
          Unix are nothing alike.
      
      testZEO.py:  Add WindowsGenericTests and WindowsZEOFileStorageTests.
          These test cases use the Windows-specific forker interface.  They also
          use getStorageInfo() to describe the storage, rather than getStorage()
          to create the storage.  This is necessary because the storage instance
          is created in a separate process.
      0be6d6ea
  28. 01 Jun, 2001 1 commit
    • Jeremy Hylton's avatar
      Fix checkReconnection(). · e670f33c
      Jeremy Hylton authored
      If an exception is raised, make sure the current transaction is
      aborted.  And catch more of the oddball exceptions that can get raised
      when a server disconnects -- like thread.error.
      e670f33c