Skip to content

Commit 75b0303

Browse files
Merge pull request #10684 from ClickHouse/fix_7939
Fix http readonly request stucks on client close
2 parents 775b349 + 00458c9 commit 75b0303

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

programs/server/HTTPHandler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ void HTTPHandler::processQuery(
567567
try
568568
{
569569
char b;
570-
//FIXME looks like MSG_DONTWAIT is useless because of POCO_BROKEN_TIMEOUTS
571570
int status = socket.receiveBytes(&b, 1, MSG_DONTWAIT | MSG_PEEK);
572571
if (status == 0)
573572
context.killCurrentQuery();

tests/queries/0_stateless/00834_cancel_http_readonly_queries_on_client_close.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ do
1010
${CLICKHOUSE_CURL} -sS --data "SELECT count() FROM system.processes WHERE query_id = 'cancel_http_readonly_queries_on_client_close'" "${CLICKHOUSE_URL}" | grep '0' && break
1111
sleep 0.2
1212
done
13+
14+
${CLICKHOUSE_CURL} -sS -X POST "${CLICKHOUSE_URL}&session_id=test_00834_session&readonly=2&cancel_http_readonly_queries_on_client_close=1" -d "CREATE TEMPORARY TABLE table_tmp AS SELECT 1 FORMAT JSON"
15+
${CLICKHOUSE_CURL} -sS "${CLICKHOUSE_URL}&session_id=test_00834_session&query=DROP+TEMPORARY+TABLE+table_tmp"
16+
17+
url_https="https://${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT_HTTPS}/?session_id=test_00834_session"
18+
${CLICKHOUSE_CURL} -sSk -X POST "$url_https&readonly=2&cancel_http_readonly_queries_on_client_close=1" -d "CREATE TEMPORARY TABLE table_tmp AS SELECT 1 FORMAT JSON"
19+
${CLICKHOUSE_CURL} -sSk "$url_https&session_id=test_00834_session&query=DROP+TEMPORARY+TABLE+table_tmp"

0 commit comments

Comments
 (0)