v.23.7New Feature

Add SYSTEM STOP LISTEN query for graceful termination

Add SYSTEM STOP LISTEN query for more graceful termination. Closes #47972. #51016 (Nikolay Degterinsky).
Introduces the SYSTEM STOP LISTEN query to enable more graceful termination of server listeners in ClickHouse.

Why it matters

This feature addresses the need for a smoother shutdown process of ClickHouse network listeners, preventing abrupt disconnections and allowing existing connections to close properly, thereby improving stability and reliability during termination.

How to use it

Execute the following query to gracefully stop listeners:

SYSTEM STOP LISTEN

This command initiates a controlled shutdown of the network listeners without immediately terminating active connections.