1. 05 Sep, 2022 3 commits
    • Balazs Gibizer's avatar
      Ignore coverage result files · 01cf2ffd
      Balazs Gibizer authored
      Change-Id: I82d120f2a04eebf40f309a5d301ad253744d9712
      01cf2ffd
    • Balazs Gibizer's avatar
      Fix fair internal lock used from eventlet.spawn_n · ee3f73a1
      Balazs Gibizer authored
      The fasteners lib in version 0.15.0 removed the
      threading.current_thread workaround for eventlet[1] because eventlet
      seemed to fixed the current_thread issues tracked in [2]. However the
      fix for [2] only fixed half of the problem. The threading.current_thread
      call works if it is called from thread created by eventlet.spawn.
      However if the thread is created with eventlet.spawn_n then
      threading.current_thread is still broken and returns the ID of the
      python native thread.
      
      The fasteners' ReaderWriterLock depends heavily on
      threading.current_thread to decide which thread holds a lock and to
      allow re-entry of that thread. This leads to the situation that
      multiple threads created from spawn_n could take the same
      ReaderWriterLock at the same time.
      
      The fair internal lock in oslo.concurrency uses ReaderWriterLock and
      as a result such lock is broken for threads created with spawn_n.
      
      Note that this issue was raised with eventlet in [3] when the nova team
      detected it via a direct usage of ReaderWriterLock in the nova test
      code. As [3] did not lead to a solution in eventlet nova implemented a
      nova local fix for the test code in [4].
      
      However now we detected that oslo.concurrency is affected by this issue
      as well.
      
      This patch restores the workaround that was removed by [1].
      
      Note that a fasteners issue [5] also opened to restore the
      workaround[1].
      
      [1] https://github.com/harlowja/fasteners/commit/467ed75ee1e9465ebff8b5edf452770befb93913
      [2] https://github.com/eventlet/eventlet/issues/172
      [3] https://github.com/eventlet/eventlet/issues/731
      [4] https://review.opendev.org/c/openstack/nova/+/813114
      [5] https://github.com/harlowja/fasteners/issues/96
      
      Closes-Bug: #1988311
      Change-Id: Ia873bcc6b07121c9bd0b94c593567d537b4c1112
      ee3f73a1
    • Balazs Gibizer's avatar
      Prove that spawn_n with fair lock is broken · 796203c9
      Balazs Gibizer authored
      The fasteners lib in version 0.15.0 removed the
      threading.current_thread workaround for eventlet[1] because eventlet
      seemed to fixed the current_thread issues tracked in [2]. However the
      fix for [2] only fixed half of the problem. The threading.current_thread
      call works if it is called from thread created by eventlet.spawn.
      However if the thread is created with eventlet.spawn_n then
      threading.current_thread is still broken and returns the ID of the
      python native thread.
      
      The fasteners' ReaderWriterLock depends heavily on
      threading.current_thread to decide which thread holds a lock and to
      allow re-entry of that thread. This leads to the situation that
      multiple threads created from spawn_n could take the same
      ReaderWriterLock at the same time.
      
      The fair internal lock in oslo.concurrency uses ReaderWriterLock and
      as a result such lock is broken for threads created with spawn_n.
      
      Note that this issue was raised with eventlet in [3] when the nova team
      detected it via a direct usage of ReaderWriterLock in the nova test
      code. As [3] did not lead to a solution in eventlet nova implemented a
      nova local fix for the test code in [4].
      
      However now we detected that oslo.concurrency is affected by this issue
      as well.
      
      This patch adds tests to show the scope of the problem.
      
      Note that the coverage tox target is changed to explicitly enable native
      threading otherwise it runs eventlet specific tests in a native
      environment.
      
      Also note that [5] was opened to reintroduce the workaround[1] in fasteners.
      
      [1] https://github.com/harlowja/fasteners/commit/467ed75ee1e9465ebff8b5edf452770befb93913
      [2] https://github.com/eventlet/eventlet/issues/172
      [3] https://github.com/eventlet/eventlet/issues/731
      [4] https://review.opendev.org/c/openstack/nova/+/813114
      [5] https://github.com/harlowja/fasteners/issues/96
      
      Related-Bug: #1988311
      Change-Id: Ibc193c855b49b95b46ebd2aac82ea89e33f885f0
      796203c9
  2. 14 Jul, 2022 1 commit
  3. 07 Jul, 2022 1 commit
    • Gorka Eguileor's avatar
      Log when waiting to acquire lock · 9800d58c
      Gorka Eguileor authored
      We currently have no log entry when we start trying to acquire a lock.
      
      In general this is ok, but there are cases where it can be problematic,
      for example if we have a deadlock situation or if a lock takes a very
      long time to be acquired.
      
      In those scenarios looking at the logs we would see the operation
      proceed normally and suddenly go completely silent without knowing that
      it's waiting for a lock to be freed.
      
      This patch adds a debug log message right before trying to acquire the
      lock so we can detect those situations.
      
      Change-Id: I1354dfb98b0927ae167802ecc4ab1d34f6b4d720
      9800d58c
  4. 21 Jun, 2022 1 commit
  5. 27 May, 2022 1 commit
  6. 05 May, 2022 1 commit
  7. 19 Apr, 2022 1 commit
  8. 05 Apr, 2022 1 commit
  9. 24 Mar, 2022 1 commit
    • Thiago Brito's avatar
      Fix RequiredOptError when missing lock_path · 11210a95
      Thiago Brito authored
      
      
      When lock_file is not present on the [oslo_concurrency] section of the
      config file, we are getting a misleading error saying that it is not
      preset on the DEFAULT group. This commit fixes it by providing the group
      arg to the RequiredOptError constructor.
      
      Closes-Bug: #1966320
      
      Signed-off-by: default avatarThiago Brito <thiago.brito@windriver.com>
      Change-Id: Idee6987739917c7eae4faee15a66085a9ef7f6d2
      11210a95
  10. 15 Mar, 2022 1 commit
  11. 02 Mar, 2022 1 commit
  12. 01 Mar, 2022 1 commit
    • Brian Rosmaita's avatar
      Allow python_exec kwarg to be None · a937c556
      Brian Rosmaita authored
      processutils.execute() is documented to take a python_exec kwarg and
      default to using sys.executable if that argument isn't set.  It is
      convenient (and more intuitive) for this behavior to also occur if
      the argument is present with value None.
      
      Closes-bug: #1962603
      Related-bug: #1962581
      Change-Id: I2e1f187feaf4bf9fbfaf04fce78efa0cba49fc07
      a937c556
  13. 21 Dec, 2021 1 commit
  14. 24 Jun, 2021 1 commit
    • Romain Poupin's avatar
      Add support for non-blocking locks · a9ccf0a6
      Romain Poupin authored
      This adds support for a non-blocking behavior of the lock : the context-based
      lock now raises an AcquireLockFailedException if the lock can't be acquired on
      the first try.
      
      At a higher layer, we just caught this exception inside the 'synchronized'
      decorator to prevent calling the wrapped function. In which case, we then
      trace this acquisition failure.
      
      For now at least, disabling blocking is not supported when using fair locks
      because the ReaderWriterLock.write_lock() provided by the fasteners module
      doesn't implements this behavior.
      
      Change-Id: I409da79007c9ba4fb8585da881e3d56998b0b98b
      a9ccf0a6
  15. 05 May, 2021 1 commit
    • YuehuiLei's avatar
      setup.cfg: Replace dashes with underscores · 8e084008
      YuehuiLei authored
      Setuptools v54.1.0 introduces a warning that the use of dash-separated
      options in 'setup.cfg' will not be supported in a future version [1].
      Get ahead of the issue by replacing the dashes with underscores. Without
      this, we see 'UserWarning' messages like the following on new enough
      versions of setuptools:
      
        UserWarning: Usage of dash-separated 'description-file' will not be
        supported in future versions. Please use the underscore name
        'description_file' instead
      
      [1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
      
      Change-Id: I4f58234e6f2d0b0b8548d1cf53c266c562b411eb
      8e084008
  16. 27 Apr, 2021 1 commit
  17. 16 Apr, 2021 2 commits
  18. 23 Mar, 2021 1 commit
  19. 19 Feb, 2021 1 commit
  20. 18 Dec, 2020 1 commit
  21. 04 Nov, 2020 2 commits
  22. 09 Oct, 2020 1 commit
  23. 30 Sep, 2020 1 commit
  24. 11 Sep, 2020 2 commits
  25. 03 Sep, 2020 1 commit
    • Hervé Beraud's avatar
      Adding pre-commit · b8f713bc
      Hervé Beraud authored
      Introduced changes:
      - pre-commit config and rules
      - Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
      - Applying fixes for pre-commit compliance in all code.
      
      Also commit hash will be used instead of version tags in pre-commit to
      prevend arbitrary code from running in developer's machines.
      
      pre-commit will be used to:
      - trailing whitespace;
      - Replaces or checks mixed line ending (mixed-line-ending);
      - Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
      - Checks that non-binary executables have a proper
        shebang (check-executables-have-shebangs);
      - Check for files that contain merge conflict strings (check-merge-conflict);
      - Check for debugger imports and py37+ breakpoint()
        calls in python source (debug-statements);
      - Attempts to load all yaml files to verify syntax (check-yaml);
      - Run flake8 checks (flake8) (local)
      
      For further details about tests please refer to:
      https://github.com/pre-commit/pre-commit-hooks
      
      
      
      Change-Id: I6ae02d4e52fd812360414e7b8c1c9c4f17230812
      Signed-off-by: default avatarMoisés Guimarães de Medeiros <moguimar@redhat.com>
      b8f713bc
  26. 24 Jul, 2020 1 commit
  27. 10 Jul, 2020 1 commit
  28. 01 Jul, 2020 1 commit
  29. 30 Jun, 2020 1 commit
  30. 24 Jun, 2020 1 commit
  31. 10 Jun, 2020 1 commit
    • Sean McGinnis's avatar
      Update lower-constraints versions · b058d507
      Sean McGinnis authored
      
      
      This updates lower constraints to versions that will work with py38 so
      that when we move to running on focal nodes, which has py38 as its
      default py3 runtime, the lower-constraints job will continue to pass.
      
      It also cleans out some secondary requirements that are no longer needed
      due to our direct dependencies being updated.
      
      Linters are removed that are kept in the global requirements blacklist
      as those are not version tracked and are not relevant for our
      lower-constraints unit test runs.
      
      Change-Id: I60af0a8c5241190e5c889ff8f9aba3a4b3acc04c
      Signed-off-by: default avatarSean McGinnis <sean.mcginnis@gmail.com>
      b058d507
  32. 08 Jun, 2020 2 commits
  33. 04 Jun, 2020 1 commit
  34. 03 Jun, 2020 1 commit