v.25.8Improvement

Check if connection is cancelled before checking

Check if connection is cancelled before checking for EOF to prevent reading from closed connection. Fixes #83893. #84227 (Raufs Dunamalijevs).
Added a check to verify if the connection is cancelled before checking for EOF to prevent reading from a closed connection.

Why it matters

This feature fixes an issue where the system could attempt to read from a closed connection, potentially causing errors or unexpected behavior. The check ensures that operations are halted early if the connection has been cancelled, improving stability and reliability.

How to use it

This fix is automatically applied in the updated version of ClickHouse. No additional user intervention or configuration is required.