When the node shuts down because of a panic, the node is supposed to stop gracefully
However, when I add a todo!() at a random place in the code, this happens:
The process is aborted and the core is dumped. I wonder what's happening, but the rocksdb "gracefully closing the db" log is not shown - it might be related..? weird
We do not use unsafe anywhere in the codebase, so I'm guessing this is probably the Drop implementation of rocksdb::DB doing this. (for those who don't know, the DB graceful close is implemented using the Drop trait, because unwinding the stack runs destructors :) )
This is lower priority as we're not supposed to panic anyway, but in case we panic we're supposed to close the db properly. Also, we are already fault-tolerant, so not closing the db properly is not that big of a deal.
For any contributor wanting to take this: the way you would debug this kind of thing is using gdb or lldb, and opening the core dump (that's what it's for ;) )
Is there an existing issue?
Description of bug
When the node shuts down because of a panic, the node is supposed to stop gracefully However, when I add a todo!() at a random place in the code, this happens:
The process is aborted and the core is dumped. I wonder what's happening, but the rocksdb "gracefully closing the db" log is not shown - it might be related..? weird We do not use
unsafe
anywhere in the codebase, so I'm guessing this is probably the Drop implementation of rocksdb::DB doing this. (for those who don't know, the DB graceful close is implemented using the Drop trait, because unwinding the stack runs destructors :) )This is lower priority as we're not supposed to panic anyway, but in case we panic we're supposed to close the db properly. Also, we are already fault-tolerant, so not closing the db properly is not that big of a deal.
Steps to reproduce
No response