[codex] Prevent concurrent AP and TP modes - #670
Draft
zhanglei1949 wants to merge 1 commit into
Draft
Conversation
zhanglei1949
force-pushed
the
codex/ap-tp-mode-validation
branch
from
July 1, 2026 07:09
c991658 to
c698233
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #663.
NeugDBServiceis destroyed.NeugDBServicefrom silently closing embedded connections on construction; it now rejects active AP connections instead.connect()/serve()entry points and add Python/C++ coverage for the AP/TP exclusion.Root Cause
AP embedded
Connectionand TPNeugDBServicecould previously be active on the sameNeugDBinstance. That allowed AP flows such as checkpoint/close cleanup to run while TP WAL/session state still referenced the old checkpoint/WAL directory, creating a data-loss hazard.Tests
/opt/homebrew/bin/cmake --build build --target test_db_svc transaction_test -j8env MODERN_GRAPH_DATA_DIR=/Users/zhanglei/code/cloud-cli/neug/example_dataset/modern_graph build/tests/unittest/test_db_svc --gtest_filter='NeugDBServiceTest.*'build/tests/transaction/transaction_test --gtest_filter='WalReplay*:CompactTransactionTest.*'PATH=/opt/homebrew/bin:$PATH PYTHON=/opt/homebrew/opt/python@3.13/bin/python3.13 JOBS=8 make devfromtools/python_bind/opt/homebrew/opt/python@3.13/bin/python3.13 -m pytest -s tests/test_tp_service.py -k 'serve_rejects_active_embedded_connection or connect_rejected_while_service_active'/opt/homebrew/bin/cmake --build build --target test_connection -j8env MODERN_GRAPH_DATA_DIR=/Users/zhanglei/code/cloud-cli/neug/example_dataset/modern_graph build/tests/unittest/test_connectiongit diff --check