Skip to content
Snippets Groups Projects
  • Dmitry Ivanov's avatar
    533dcafe
    fix: various improvements to the panic hook · 533dcafe
    Dmitry Ivanov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
    This patch boils down to the following changes:
    
    * Register the hook for all cli commands (previously only `run`).
    * Print the whole text as one log line to prevent splitting.
    * Always capture backtrace regardless of RUST_BACKTRACE and such.
    
    Currently, we act under the assumption that every panic is severe
    and should abort the whole process. This **does not** have to always
    be the case -- for instance, we might recover from a mild panic in
    Sbroad's query planner if the application state hasn't been corrupted.
    A happy outcome isn't completely ruled out.
    
    In the future we might change this behavior by replacing the
    uncompromising global panic hook with a combo of strategically placed
    `std::panic::catch_unwind`s and a panic hook for non-unwinding panics.
    
    At the moment of writing, `PanicHookInfo::can_unwind` is still unstable.
    533dcafe
    History
    fix: various improvements to the panic hook
    Dmitry Ivanov authored and Dmitry Ivanov's avatar Dmitry Ivanov committed
    This patch boils down to the following changes:
    
    * Register the hook for all cli commands (previously only `run`).
    * Print the whole text as one log line to prevent splitting.
    * Always capture backtrace regardless of RUST_BACKTRACE and such.
    
    Currently, we act under the assumption that every panic is severe
    and should abort the whole process. This **does not** have to always
    be the case -- for instance, we might recover from a mild panic in
    Sbroad's query planner if the application state hasn't been corrupted.
    A happy outcome isn't completely ruled out.
    
    In the future we might change this behavior by replacing the
    uncompromising global panic hook with a combo of strategically placed
    `std::panic::catch_unwind`s and a panic hook for non-unwinding panics.
    
    At the moment of writing, `PanicHookInfo::can_unwind` is still unstable.