viirya commented on PR #7042:
URL: 
https://github.com/apache/datafusion-comet/pull/7042#issuecomment-6284213473

   Thanks @sunchao and @rich7420, the same-message case is real, and I don't 
think the boundary can close it. Once the hook has run, nothing tells us 
whether that panic was later caught and handled, and a resumed panic skips the 
hook. Comparing payload addresses doesn't help either: identical string 
literals are commonly merged, as in the suggested test. So whenever a panic 
arrives without a hook run of its own, any captured backtrace is a guess.
   
   I changed the approach instead. The panic hook now logs the backtrace to 
stderr with the panic message and location, on the thread that panicked, and 
`CometNativeException` carries the panic message only. That removes the shared 
slot from #7041 and the per-thread capture, so there is nothing left to 
attribute, and the executor log has the backtrace of every panic, including a 
resumed one, which the exception never had reliably.
   
   The trade-off is that the stack frames are no longer in the exception 
message, so they have to be read from the executor log. I noted that in 
`debugging.md` and updated the description. 
`panic_exception_carries_only_its_message` covers a panic on the calling 
thread, a resumed panic, and the same-message case from the suggestion.
   


-- 
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