fix(actor): move namespace filter inside lock in ActorLoader.list_actors (#8660) #11038

Merged
HAL9000 merged 5 commits from 8660-move-namespace-filter-inside-lock into master 2026-06-14 19:50:10 +00:00

5 Commits

Author SHA1 Message Date
cleveragents-auto 17c6e5f4ea chore: worker ruff auto-fix (pre-push lint gate)
CI / lint (pull_request) Successful in 1m2s
CI / typecheck (pull_request) Successful in 1m15s
CI / security (pull_request) Successful in 1m20s
CI / quality (pull_request) Successful in 51s
CI / build (pull_request) Successful in 1m0s
CI / helm (pull_request) Successful in 43s
CI / push-validation (pull_request) Successful in 26s
CI / unit_tests (pull_request) Successful in 6m53s
CI / docker (pull_request) Successful in 1m40s
CI / integration_tests (pull_request) Successful in 10m16s
CI / coverage (pull_request) Successful in 14m40s
CI / status-check (pull_request) Successful in 11s
2026-06-14 15:26:27 -04:00
HAL9000 c69e960696 fix(actor): repair list_actors lock-filter test fixtures (#8588)
Address CI lint + unit_tests failures on the namespace-lock test suite:

- Step file: drop unused imports (yaml, ExitStack, ValidationError) and
  unused noqa directives flagged by ruff F401/RUF100; rewrite the
  collected-errors list to use iterable unpacking (RUF005); register the
  "I create an ActorLoader with initial actors from multiple namespaces"
  step under both @given and @when so scenario 3 is no longer reported as
  undefined; remove the dead _error_collector inner function the reviewer
  flagged.
- Step regex fix: the concurrent-modifications step pattern ended with
  '' (two single quotes) instead of `` (two backticks), so it never
  matched the feature file's `(triggering ``discover()``)` literal.
- Test fixtures: add the required `description` field to _make_actor_yaml
  in both the BDD step file and tests/actor/test_loader_list_actors_thread_safety.py
  so ActorConfigSchema validation passes (previously every scenario
  errored at discover() with "description: Field required").
- Concurrent worker names: collapse three-slash actor names like
  "conc/ns{i % 2}/concurrent_{i}" to the single-slash form
  "conc/concurrent_{i}" required by the schema's namespaced-name rule.
- Test file: drop unused `yaml` import and three unused F841 assignments
  in _list_worker; apply ruff format.
- Feature file: switch the @issue_8660 TDD tag to @tdd_issue_8588 to
  match the CONTRIBUTING.md tag convention for the bug issue this PR
  closes.

ISSUES CLOSED: #8588
2026-06-14 15:26:27 -04:00
controller-ci-rerun 5c24ef1f28 chore: re-trigger CI [controller] 2026-06-14 15:26:27 -04:00
controller-ci-rerun e96dc8cfae chore: re-trigger CI [controller] 2026-06-14 15:26:27 -04:00
HAL9000 1c4f763685 fix(actor): move namespace filter inside lock in ActorLoader.list_actors (#8660)
Fixes a race condition where the namespace filter was applied outside
the threading.RLock, allowing concurrent mutations (discover(), clear())
to corrupt the iteration state. The filter now runs inside the locked
section, matching the locking discipline of all other public methods.

- Moved namespace filtering inside lock in list_actors()
- Added BDD concurrency regression test
- Added unit test for thread-safety under concurrent discover/clear
- Updated CHANGELOG.md with fix description
- Updated CONTRIBUTORS.md

ISSUES CLOSED: #8588
2026-06-14 15:26:27 -04:00