Repository navigation
Conversation
…dled getCurrentExceptionCode and getCurrentExceptionMessageAndPattern rethrow with `throw;`, which calls std::terminate when no exception is being handled. That happens in a destructor during stack unwinding, where std::uncaught_exceptions() is already non-zero: TransactionManager::rollbackTransaction calls getCurrentExceptionCode exactly then when a MergeTreeTransactionHolder is destroyed by an escaping exception. Return OK / an empty message instead. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Workflow [PR], commit [2291bdc] Summary: ✅
AI ReviewSummaryThis PR hardens the current-exception helpers so they no longer call Final Verdict✅ No new findings. LLVM Coverage ReportMeasured on commit 2291bdc.
Changed lines: Changed C/C++ lines covered: 19/19 (100.00%) · Uncovered code |
clang-analyzer-deadcode.DeadStores flagged the aggregate probe whose destructor writes through references. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units9 translation units recompiled, 16 s compile time in total, 9 of them have a recent master baseline. |
… trace tryLogCurrentException still reached a bare throw; with no handled exception. The rollback trace printed code 0 for an exception still in flight during unwinding. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
getCurrentExceptionCodeandgetCurrentExceptionMessageAndPattern(behindgetCurrentExceptionMessageandtryLogCurrentException) inspect the current exception by rethrowing it withthrow;. That is only legal while an exception is being handled; with none,throw;callsstd::terminate.A destructor that runs during stack unwinding hits exactly that case:
{ MergeTreeTransactionHolder holder(txn); // RUNNING transaction, autocommit = false throw Exception(...); // an exception escapes the scope } // stack unwinding, no catch has run yet: ~MergeTreeTransactionHolder() TransactionManager::rollbackTransaction(txn) LOG_TRACE(log, "Rolling back transaction {}{}", txn->tid, std::uncaught_exceptions() // 1: an exception is in flight ? fmt::format(" ... (code: {})", getCurrentExceptionCode()) : ""); getCurrentExceptionCode() try { throw; } // nothing is being handled → std::terminate() // the server diesBoth helpers now return early when
std::current_exception()is null:OKand an empty message.tryLogCurrentExceptionImplgets the same guard, since it rethrows once more to mark the exception as logged.rollbackTransactionprints the code only when an exception is being handled; during unwinding the in-flight exception is not observable, so the trace omits the code instead of printing0.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/122891]
Version info
26.10.1.1036-master(included in26.10and later)