1. 06 Dec, 2002 2 commits
    • Barry Warsaw's avatar
      OpenRecoveryTest: New test for recovering from problems passing in a · bd066aff
      Barry Warsaw authored
      bogus config object.
      bd066aff
    • Barry Warsaw's avatar
      Rework the background threads to be poll-with-timeout based instead of · 6e8fbfb4
      Barry Warsaw authored
      sleep based.  We create two ends of a pipe in the parent thread, with
      the child thread polling/reading one end and the parent writing to the
      other.  The only thing written to this pipe is a "stop marker" -- just
      a string that wakes the thread up immediately when we're closing the
      storage.
      
      The primary reason for this is to speed up shutdown so that we don't
      have to wait for the next tick of the sleep counter before we'll
      trigger the thread shutdown.  Makes shutting down Zope using this
      storage much quicker.
      
      Specific changes include:
      
      BerkeleyBase.py
      
          SLEEP_TIME -> JOIN_TIME since it's now just the interval we'll
          wait for the thread.join to complete.
      
          __init__():	Create both the checkpointer thread and the autopacker
          thread, set up the pipes, and get them both rolling.  We refactor
          creation of the autopacker instance into a separate overrideable
          method since this is the one bit that's different between the two
          storages.
      
          _make_autopacker(): Intended to be overridden.
      
          close(), _doclose(): Move the thread shutdown code out of the
          lock, since we don't want to potentially deadlock the shutting
          down of the background thread.  This could happen if close() was
          entered when the autopacker thread was between lock acquisitions
          in _dopack().  Also, be sure to write to the pipe to wake the
          child threads up immediately.
      
          env_from_string(): Wrap the actual creation and opening of the
          environment in a try/except, so that if there's a failure, we can
          be sure to give up the file lock.
      
          _WorkThread class: Accept a poll object which wraps the read end
          of the pipe.  Rework run() to do the poll-with-timeout instead of
          sleep.  I don't think we strictly need to do the fd read given the
          simplicity (and mono-commandity) of the protocol, but it can't
          hurt.  The _dowork() method's signature no longer contains the
          `now' variable.
      
      Full.py
      
          _make_autopacker(): Override base class to return storage specific
          _Autopack instance.
      
      Minimal.py
      
          Same, but also include some code cleanup.
      
      
      Also, get rid of some unnecessary imports.
      6e8fbfb4
  2. 05 Dec, 2002 3 commits
    • Casey Duncan's avatar
      Merging pluginindex cleanup into the head · 680fb65b
      Casey Duncan authored
      680fb65b
    • Casey Duncan's avatar
      Major refactor of the catalog search engine centered around optimizing sort by... · 2167f3f6
      Casey Duncan authored
      Major refactor of the catalog search engine centered around optimizing sort by index operations. The resulting code greatly outperforms the previous version and uses less memory.
      
      Exposed a new ZCatalog method "search" which has a better interface for programmatic searches. Updated documentation as well.
      
      Implemented a sort limit option which allows you to inform the catalog that you are only interested in a certain number of results. In the common case this allows the ZCatalog machinery to use a different sorting algorithm (N-Best) which scales much better then a full sort.
      
      Also more tightly integrated the merge option which allows you to tell the catalog that you would like raw and unsorted intermediate results returned rather than sorted and lazified results. This can be used to efficiently merge search results across multiple catalogs.
      2167f3f6
    • Barry Warsaw's avatar
      0f4c1093
  3. 04 Dec, 2002 1 commit
  4. 03 Dec, 2002 4 commits
    • Guido van Rossum's avatar
      Fix a bug in unindexing removed messages (it was iterating over a lazy · 0fe8faf6
      Guido van Rossum authored
      list that was being modified as we went).
      [Backport from Zope3; I'm not actually sure if the list returned by
      **Btree.keys() is lazy, but I assume it is.]
      0fe8faf6
    • Barry Warsaw's avatar
      _setupDB(): Port to BerkeleyDB 4.1, and pybsddb 4.1 (experimental): · 0c9da1d4
      Barry Warsaw authored
              # DB 4.1.24 requires that operations happening in a transaction must
              # be performed on a database that was opened in a transaction.  Since
              # we do the former, we must do the latter.  However, earlier DB
              # versions don't transactionally protect database open, so this is the
              # most portable way to write the code.
      
      i.e. we use the DB_AUTO_COMMIT flag for the open, if it's defined.
      0c9da1d4
    • Barry Warsaw's avatar
      Ported to pybsddb 4.1 (experimental), these changes are actually the · 0d4d91f1
      Barry Warsaw authored
      right thing to do anyway, and should work just find for earlier
      versions of the wrapper.  Specifically,
      
      _dorecovery(), _collect_objs(), _mark(): transactionally protect
      .truncate() and .consume()
      
      _docommit(): Move the setting of the _pending flag to here from
      _finish() so we can transactionally protect it more conveniently.
      This does't change the semantics and the recovery code in _setupDBs()
      doesn't care since the flag will already be set to COMMIT.
      0d4d91f1
    • Barry Warsaw's avatar
      Ported to pybsddb 4.1 (experimental), these changes are actually the · 86e7e1c5
      Barry Warsaw authored
      right thing to do anyway, and should work just find for earlier
      versions of the wrapper.  Specifically,
      
      _doabort(), _docommit(), _mark(), _sweep(), _collect_objs():
      Transactionally protect .truncate() and .consume()
      
      _docommit(): Move the setting of the _pending flag to here from
      _finish() so we can transactionally protect it more conveniently.
      This does't change the semantics and the recovery code in _setupDBs()
      doesn't care since the flag will already be set to COMMIT.
      
      _begin(): Transactionally protect the setting of the _pending flag to
      ABORT.
      86e7e1c5
  5. 02 Dec, 2002 2 commits
  6. 30 Nov, 2002 2 commits
  7. 28 Nov, 2002 4 commits
  8. 27 Nov, 2002 2 commits
  9. 26 Nov, 2002 4 commits
  10. 25 Nov, 2002 3 commits
  11. 24 Nov, 2002 4 commits
  12. 23 Nov, 2002 2 commits
  13. 22 Nov, 2002 6 commits
  14. 21 Nov, 2002 1 commit
    • Fred Drake's avatar
      - zLOG.severity(): Convenience function that converts a value to a · 0dafb70a
      Fred Drake authored
        severity level.  This allows the common names to be used for
        severities, not just integers.  This can make configuration data
        less obscure.
      
      - Refactor initialize():
        get_environment_info() pulls information from the environment
        variables, and this gets passed to initialize_log(), which does
        nothing to determine the source of the configuration data.
      
      - New method initialize_with_config():  Load information not provided
        by the environment from a ZConfig section.  This allows the
        environment to override a config file, and avoids having the
        application deal with the specific information needed to configure
        logging.
      0dafb70a