Skip to content

Fix NamespaceSet.clear() fires del-hook once per item not per backend#515

Closed
zrgt wants to merge 1 commit into
eclipse-basyx:developfrom
rwth-iat:fix/b4-namespaceset-clear-hook
Closed

Fix NamespaceSet.clear() fires del-hook once per item not per backend#515
zrgt wants to merge 1 commit into
eclipse-basyx:developfrom
rwth-iat:fix/b4-namespaceset-clear-hook

Conversation

@zrgt

@zrgt zrgt commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

NamespaceSet.clear() iterated all backends and called _execute_item_del_hook for each item in each backend. With M backends and N items this fired M×N hook calls instead of N.

Fix collects items from first backend only, fires hook once per item, then clears all backends.

Fixes #497

Test plan

  • test_namespaceset_clear_hook_called_once_per_item — 2 items + 2 backends → exactly 2 hook calls
  • Full test.model.test_base suite passes (53 tests)

clear() iterated all backends firing _execute_item_del_hook for each,
resulting in N*M calls (N items, M backends) instead of N.
Fix collects items from first backend only before firing hooks.

Fixes eclipse-basyx#497
@zrgt

zrgt commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Not relevant for now, as only one backend will be used in production code

@zrgt zrgt closed this May 7, 2026
@s-heppner s-heppner deleted the fix/b4-namespaceset-clear-hook branch May 14, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant