1. 11 May, 2021 1 commit
  2. 10 May, 2021 1 commit
  3. 15 Mar, 2021 1 commit
    • Kirill Smelkov's avatar
      demo: URI resolver · 2f02bc90
      Kirill Smelkov authored
      This patch adds `demo:` URI scheme to create DemoStorage from an URI.
      
      While several existing resolvers already handle ?demostorage argument to
      wrap itself with DemoStorage and in-RAM MappingStorage for changes, this
      approach has the following drawbacks:
      
      - every resolver must do it
      - it is not possible to create DemoStorage with non-MappingStorage for changes.
      
      My particular motivation here is Wendelin.core 2: it spawn WCFS
      filesystem server to serve array data from ZODB storage, and passes
      storage URL to spawned wcfs process, so that wcfs could connect and
      retrieve data from the same ZODB storage that client process is
      using. When original ERP5 client is using DemoStorage, both `base` and
      `changes` must be persisted because if changes would be in-RAM
      MappingStorage, WCFS could not access that data because it runs as a
      separate process.
      
      To build a DemoStorage URI we follow XRI Cross-references approach to
      embed URIs for base and changes into combining demo URI:
      
          demo:(base_uri)/(δ_uri)
      
      https://en.wikipedia.org/wiki/Extensible_Resource_Identifier provides
      some related details and examples.
      
      I choose fragments as the place for ZODB.DB arguments:
      
          demo:(base_uri)/(δ_uri)#dbkw...
      
      The reason fragments - instead of parameters - are used, is because
      DB arguments are _local_. Even with different DB arguments the URI
      refers to the same storage, and for wendelin.core 2 it is important to
      be able to determine whether two client processes actually use the same
      underlying ZODB storage, even if those two clients use different local
      parameters, like connection_pool_size and similar. Keeping such local
      arguments in fragments makes it easy to determine the underlying URI of
      the storage - by dropping fragments. It also follows logic from RFC 3986,
      which says that "fragment ... may be ... some view on representations of
      the primary resource": https://tools.ietf.org/html/rfc3986#section-3.5
      
      Thanks beforehand,
      Kirill
      
      /cc @tseaver, @azmeuk, @jimfulton
      
      P.S.
      
      It was already suggested several times to add DemoStorageURIResolver and
      deprecate ?demostorage in existing URI resolvers:
      
      https://github.com/Pylons/zodburi/pull/25#issuecomment-485506959
      https://github.com/Pylons/zodburi/pull/25#issuecomment-511480572
      https://github.com/Pylons/zodburi/pull/25#issuecomment-622931793
      2f02bc90
  4. 02 May, 2020 1 commit
  5. 15 Nov, 2019 1 commit
  6. 14 Nov, 2019 1 commit
  7. 22 Jan, 2019 1 commit
  8. 21 Jan, 2019 1 commit
  9. 18 Jan, 2019 2 commits
  10. 11 Jan, 2019 3 commits
  11. 22 Nov, 2018 1 commit
  12. 20 Nov, 2018 1 commit
  13. 19 Nov, 2018 1 commit
  14. 02 Oct, 2018 10 commits
  15. 17 Oct, 2017 7 commits
    • Tres Seaver's avatar
      svb · c59d6660
      Tres Seaver authored
      c59d6660
    • Tres Seaver's avatar
      Prep 2.3.0 release. · 01f15788
      Tres Seaver authored
      01f15788
    • Tres Seaver's avatar
      Garden changelog. · 51b9ec7c
      Tres Seaver authored
      51b9ec7c
    • Tres Seaver's avatar
      Use '.rst' for changelog. · a1db64c1
      Tres Seaver authored
      Fix typo in Trove classifiers.
      a1db64c1
    • Tres Seaver's avatar
      Merge pull request #20 from navytux/y/zeo-ipv6 · 1688e10b
      Tres Seaver authored
      zeo: Fix parsing URI with IPv6 address
      1688e10b
    • Kirill Smelkov's avatar
      Sign CLA. · a3b501ce
      Kirill Smelkov authored
      a3b501ce
    • Kirill Smelkov's avatar
      zeo: Fix parsing URI with IPv6 address · 696b84c4
      Kirill Smelkov authored
      The code was crashing this way:
      
      ---- 8< ----
      ======================================================================
      ERROR: test_call_ipv6 (zodburi.tests.test_resolvers.TestClientStorageURIResolver)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/kirr/src/wendelin/venv/z-dev/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
          return func(*args, **keywargs)
        File "/home/kirr/src/wendelin/z/zodburi/zodburi/tests/test_resolvers.py", line 265, in test_call_ipv6
          factory, dbkw = resolver('zeo://[::1]:9090?debug=true')
        File "/home/kirr/src/wendelin/z/zodburi/zodburi/resolvers.py", line 141, in __call__
          host, port = netloc.split(':')
      ValueError: too many values to unpack
      
      ======================================================================
      ERROR: test_call_ipv6_no_port (zodburi.tests.test_resolvers.TestClientStorageURIResolver)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/kirr/src/wendelin/venv/z-dev/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
          return func(*args, **keywargs)
        File "/home/kirr/src/wendelin/z/zodburi/zodburi/tests/test_resolvers.py", line 258, in test_call_ipv6_no_port
          factory, dbkw = resolver('zeo://[::1]?debug=true')
        File "/home/kirr/src/wendelin/z/zodburi/zodburi/resolvers.py", line 141, in __call__
          host, port = netloc.split(':')
      ValueError: too many values to unpack
      ---- 8< ----
      
      Fix it by leveraging the fact that urlparse.urlsplit return() tuple-like object
      with additional .hostname and .port attributes which already parse IPv6 correctly:
      
      In [2]: u = urlsplit('http://[::1]:5553')
      
      In [3]: u
      Out[3]: SplitResult(scheme='http', netloc='[::1]:5553', path='', query='', fragment='')
      
      In [4]: u.netloc
      Out[4]: '[::1]:5553'
      
      In [5]: u.hostname
      Out[5]: '::1'
      
      In [6]: u.port
      Out[6]: 5553
      
      In [7]: u = urlsplit('http://[::1]')
      
      In [8]: u.hostname
      Out[8]: '::1'
      
      In [9]: u.port
      
      In [10]: repr(u.port)
      Out[10]: 'None'
      696b84c4
  16. 06 Oct, 2017 4 commits
  17. 05 May, 2017 3 commits