kamcheungting-db opened a new pull request, #872:
URL: https://github.com/apache/iceberg-cpp/pull/872

   Follow-up to #725 (merged): the registered `FatalHandler` runs only for the 
fixed-severity `ICEBERG_LOG_FATAL`. Reaching `kFatal` through the runtime-level 
forms aborts **without** invoking it:
   
   - `ICEBERG_LOG(LogLevel::kFatal, ...)` → `LogToCurrentRuntime` flushes and 
aborts, no handler.
   - `ICEBERG_LOG_TO(sink, LogLevel::kFatal, ...)` → `LogToExplicitRuntime`, 
same.
   
   Those paths also format the message only when `ShouldLog(kFatal)` passes, so 
a handler (once wired) would miss the text for a filtered record. This was 
raised in review on #726; the fix didn't make it into the #725 merge, so it is 
submitted separately here.
   
   **Change:** extract the fatal sequence into a shared 
`internal::DispatchFatal` — format the message once, emit it if the logger is 
enabled, flush that same logger, run any registered `FatalHandler`, then 
`std::abort()` — and route all three fatal paths (`LogFatal`, 
`LogToCurrentRuntime`, `LogToExplicitRuntime`) through it. A handler that 
itself throws cannot prevent the abort.
   
   **Tests:** two death tests asserting the handler fires for the generic 
runtime-level `kFatal` and for `ICEBERG_LOG_TO(..., kFatal)`.
   
   Behavior for non-fatal levels and for `ICEBERG_LOG_FATAL` is unchanged.
   
   This pull request and its description were written by Isaac.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to