Skip to content

feat(config): register prepared batches atomically - #165

Draft
LimiNode wants to merge 1 commit into
mainfrom
feat/atomic-config-registration
Draft

LimiNode wants to merge 1 commit into
mainfrom
feat/atomic-config-registration

Conversation

@LimiNode

@LimiNode LimiNode commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements ADR-0010 after #164 was merged and its post-merge CI/publish passed.

  • Preserve legacy add_logger(unique_ptr, unique_ptr, bool), use shared internal owners, and repair its snapshot allocation exception safety.
  • Add Logger::register_configuration(prepared, options, output, diagnostics) with per-ID enabled/single_mode flags and shared_ptr output containing indices.
  • Validate manual batches, IDs, objects, canonical cross-strategy aliases, combined-interface ownership, and the INT_MAX count boundary.
  • Prebuild registry, configured-ID map, snapshot, and immutable result before a non-throwing commit; publish one snapshot, with no publication for valid empty batches.
  • Linearize registration/shutdown under the registry lock; capability queries, backend shutdown callbacks, and displaced owners run outside it. No dispatch hot-path locks are added.

Verification

  • Full MSVC Debug CTest: 65/65; full MSVC Release CTest: 65/65.
  • New registration and process-isolated shutdown regressions: 3/3 in Debug and Release, including both shutdown orders, reentrant callbacks, conflicting writers, and fault injection for snapshot, result, and partial result-map construction.
  • GCC C++11/C++17 Release-active registration/shutdown runs; strict compilation with -Wall -Wextra -Werror -Wno-unused-parameter (the excluded warning is pre-existing in runtime builtins).
  • C++17 configuration suite with optional JSON enabled: 5/5.
  • Installed CMake package consumer, multi-TU ODR test, Doxygen 1.12, generated local links, and git diff --check passed.
  • Exact-head CI: 15/15 jobs passed, including Linux/macOS/Windows, ASan/UBSan, TSan, ODR, pkg-config consumers, and Emscripten. CI run: https://github.com/LimiNode/log-it-cpp/actions/runs/44670130116 ; publish passed: https://github.com/LimiNode/log-it-cpp/actions/runs/44670130137 .

Boundaries

Append-only; no hot reload, replacement, parser changes, file watching, or public singleton reset. Backend construction side effects are not transactional. Shared owners preserve lifetime but do not authorize unsynchronized external invocation/mutation/shutdown. Allocation exceptions may propagate before commit while preserving the live registry and old output.

Keep Draft and unmerged for independent implementation review.

Implement ADR-0010 with shared internal ownership, canonical alias checks, per-ID routing options, and immutable ID-to-index results. Build complete registry, ID map, snapshot, and result candidates before non-throwing publication, repair legacy add_logger exception safety, and serialize registration with shutdown without invoking backend callbacks under the registry lock.

Add Release-active validation, ownership, allocation-failure, concurrent-writer, snapshot, and process-isolated shutdown regressions. Exercise the API in installed consumers and Emscripten, and document the C++11 contract in English and Russian.

This branch has not been deployed

No deployments
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