Zurab Kiknavelidze
08/04/2026, 11:00 AMRocky
08/04/2026, 11:01 AMKILL command.
1. Identify the Connection or Query ID
First, find the ID of the session or query you want to stop:
* To see all active connections:
sql
SHOW [FULL] PROCESSLIST;
Look for the Id column.
* To see all running queries (with more detail):
sql
SHOW PROC '/current_queries';
Look for the ConnectionId or QueryId.
* To get your own current connection ID:
sql
SELECT CONNECTION_ID();
2. Kill the Connection or Query
* To terminate a connection (and its current query):
sql
KILL <connection_id>;
-- OR
KILL CONNECTION <connection_id>;
This closes the session and stops any running statement.
* To terminate only the current query (keeps the connection open):
sql
KILL QUERY <connection_id>;
Summary of Syntax
Command | Description
KILL <id> | Terminates the connection associated with the processlist_id.
KILL CONNECTION <id> | Same as KILL <id>.
KILL QUERY <id> | Stops the query the connection is executing but leaves the connection intact.
Note: No special privileges are required for a user to kill their own connections. To kill connections of other users, you typically need administrative privileges.
References
• administration/management/resource_management/Query_management.md
• sql-reference/sql-statements/cluster-management/nodes_processes/KILL.md
• faq/Sql_faq.md
• administration/management/monitor_manage_big_queries.md
• administration/management/FE_configuration.mdZurab Kiknavelidze
08/04/2026, 11:02 AMRocky
08/04/2026, 11:02 AM[HY000][1094] Unknown thread id occurs because connection IDs (thread IDs) are local to the specific FE (Frontend) node that accepted the connection.
If your StarRocks cluster has multiple FEs and you are connected to FE-A, but the connection you want to kill is on FE-B, FE-A will not recognize the ID and will return the "Unknown thread id" error.
How to resolve this
1. Locate the correct FE
Use the following command to find which FE node is hosting the connection/query:
sql
SHOW PROC '/global_current_queries';
_Note: If your version is older than 3.4, use SHOW PROC '/current_queries'; on each FE individually._
In the output, look for the feIp column associated with your ConnectionId or QueryId.
2. Connect directly to that FE
Once you have the feIp, you must connect your MySQL client specifically to that IP address (using the same query port, usually 9030).
3. Issue the KILL command
After connecting to the correct FE, run the command again:
sql
KILL <connection_id>;
Why does this happen?
StarRocks follows the MySQL protocol where connection management is handled by the server (FE) that maintains the TCP session. While StarRocks shares metadata across FEs, the actual active session/thread state is stored in the memory of the specific FE node handling that client.
Summary of useful commands
* See local connections: SHOW PROCESSLIST;
* See connections across all FEs: SHOW PROC '/global_current_queries'; (v3.4+)
* Kill a query by ID (instead of connection): KILL QUERY <query_id>; (This also usually needs to be run on the originating FE).
References
• sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_PROC.md
• using_starrocks/running_queries.md
• administration/management/monitor_manage_big_queries.md