Skip to content

Cannot cancel queries #34397

@daledude

Description

@daledude

Clickhouse server version: 21.8.13

Not sure if there is a config option or if this is a bug or, hopefully not, expected behaviour.

Running simple SELECT's using clickhouse-client takes a very long time to cancel after CTRL-C and Cancelling query. is output. Query continues to run to completion.

SELECT *
FROM journald_log
WHERE CONTAINER_ID = '9aed59e2301b'
LIMIT 1

Query id: 731d16bd-be9f-44fb-a4dc-7b9a39ec8ee4

^CCancelling query.
Ok.
Query was cancelled.

0 rows in set. Elapsed: 132.414 sec. Processed 11.23 thousand rows, 464.87 KB (84.82 rows/s., 3.51 KB/s.)

Did this 56 secs into query and about 40 seconds after I hit CTRL-C

Row 1:
──────
is_initial_query:     1
user:                 default
query_id:             731d16bd-be9f-44fb-a4dc-7b9a39ec8ee4
address:              ::ffff:127.0.0.1
port:                 51024
initial_user:         default
initial_query_id:     731d16bd-be9f-44fb-a4dc-7b9a39ec8ee4
initial_address:      ::ffff:127.0.0.1
initial_port:         51024
interface:            1
os_user:              root
client_hostname:      logserver4n1
client_name:          ClickHouse
client_revision:      54450
client_version_major: 21
client_version_minor: 11
client_version_patch: 4
http_method:          0
http_user_agent:
http_referer:
forwarded_for:
quota_key:
elapsed:              56.319998401
is_cancelled:         0
read_rows:            2240
read_bytes:           197017
total_rows_approx:    1641664746
written_rows:         0
written_bytes:        0
memory_usage:         17280588
peak_memory_usage:    17280588
query:                select * from journald_log where CONTAINER_ID='9aed59e2301b' limit 1;
thread_ids:           [257,82,110,149,87,157,155,167,90,106,100,124,164,83,85,60,112,156,150,165,155,150,161,165,87,164,164,87,87,164,167,165,165,165,85,150,150,150,161,112,112,112,112,112,155,149,149,149,149,149,149,149,149,149,149,149,98,81,196,103,77,168,61,206,64,84,63,89,88,121,114,190,104,62,66,158,68]
ProfileEvents:        {'Query':1,'SelectQuery':1,'FileOpen':919,'Seek':399,'ReadBufferFromFileDescriptorRead':918,'ReadBufferFromFileDescriptorReadBytes':24073456936,'ReadCompressedBytes':237824,'CompressedReadBufferBlocks':111,'CompressedReadBufferBytes':7379518,'IOBufferAllocs':1029,'IOBufferAllocBytes':25109527605,'FunctionExecute':11,'MarkCacheHits':112,'MarkCacheMisses':399,'CreatedReadBufferOrdinary':919,'DiskReadElapsedMicroseconds':650510984,'NetworkReceiveElapsedMicroseconds':4008,'NetworkSendElapsedMicroseconds':8140,'NetworkReceiveBytes':1,'NetworkSendBytes':3919,'SlowRead':5,'ReadBackoff':2,'SelectedParts':55,'SelectedRanges':2740,'SelectedMarks':51313035,'SelectedRows':2240,'SelectedBytes':197017,'ContextLock':171,'RWLockAcquiredReadLocks':1,'RealTimeMicroseconds':219953202,'UserTimeMicroseconds':47794306,'SystemTimeMicroseconds':5408055,'SoftPageFaults':1253972,'HardPageFaults':3,'OSIOWaitMicroseconds':164730000,'OSCPUWaitMicroseconds':838344,'OSCPUVirtualTimeMicroseconds':53202335,'OSReadBytes':2765012992,'OSWriteBytes':16384,'OSReadChars':3338966410,'OSWriteChars':49194,'QueryProfilerSignalOverruns':488}
Settings:             {'load_balancing':'random','max_memory_usage':'10000000000','send_logs_level':'debug'}
current_database:     logs

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions