You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Joe McDonnell (Jira)" <ji...@apache.org> on 2024/08/19 17:09:00 UTC
[jira] [Resolved] (IMPALA-13230) Add a way to dump stack traces for impala-shell while it is running
[ https://issues.apache.org/jira/browse/IMPALA-13230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joe McDonnell resolved IMPALA-13230.
------------------------------------
Fix Version/s: Impala 4.5.0
Assignee: Joe McDonnell
Resolution: Fixed
> Add a way to dump stack traces for impala-shell while it is running
> -------------------------------------------------------------------
>
> Key: IMPALA-13230
> URL: https://issues.apache.org/jira/browse/IMPALA-13230
> Project: IMPALA
> Issue Type: Task
> Components: Clients
> Affects Versions: Impala 4.5.0
> Reporter: Joe McDonnell
> Assignee: Joe McDonnell
> Priority: Major
> Fix For: Impala 4.5.0
>
>
> It can be useful to get the Python stack traces for impala-shell when it is stuck. There is a nice thread on Stack Overflow about how to do this: [https://stackoverflow.com/questions/132058/showing-the-stack-trace-from-a-running-python-application]
> One option is to install a signal handler for the SIGUSR1 signal and use that to dump a backtrace. I tried this and it works for Python 3 (but causes issues for running queries on Python 2):
> {noformat}
> # For debugging, it is useful to handle the SIGUSR1 symbol and use it to print a
> # stacktrace
> signal.signal(signal.SIGUSR1, lambda sid, stack: traceback.print_stack(stack)){noformat}
> Another option mentioned is the faulthandler module ([https://docs.python.org/dev/library/faulthandler.html|https://docs.python.org/dev/library/faulthandler.html)] ), which provides a way to do the same thing. The faulthandler module seems to be able to do this for all threads, not just the main thread.
> Either way, this would give us some options if we need to debug impala-shell out in the wild.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)