---
title: "Comment by Dmitry Titov on \"Shared resource lock powered by Clickhouse\" | Hashnode"
description: "Another funny idea to investigate: Single ClickHouse server can&#39;t have 2 queries with the same query id... In first shell: &gt; clickhouse-client --query &q"
url: "https://hashnode.com/posts/shared-resource-lock-powered-by-clickhouse/634d5e48c454aa2b493c1a19/comment/635c4dcbb872be2ebe1eb741"
---

[Discussion](https://hashnode.com/posts/shared-resource-lock-powered-by-clickhouse/634d5e48c454aa2b493c1a19)

Comment [Shared resource lock powered by Clickhouse](https://hashnode.com/posts/shared-resource-lock-powered-by-clickhouse/634d5e48c454aa2b493c1a19)

[Dmitry Titov](https://hashnode.com/@UnamedRus)

[Oct 28, 2022](https://hashnode.com/posts/shared-resource-lock-powered-by-clickhouse/634d5e48c454aa2b493c1a19/comment/635c4dcbb872be2ebe1eb741)

Another funny idea to investigate:

Single ClickHouse server can't have 2 queries with the same query id...

```

In first shell:

> clickhouse-client --query "SELECT sleepEachRow(3) FROM system.zeros FORMAT Null SETTINGS max_block_size=1" --query_id 2 --send_timeout 1


In second shell:

> clickhouse-client --query "SELECT sleepEachRow(3) FROM system.zeros FORMAT Null SETTINGS max_block_size=1" --query_id 2 --send_timeout 1

Received exception from server (version 22.10.1):
Code: 216. DB::Exception: Received from localhost:9000. DB::Exception: Query with id = 2 is already running.. (QUERY_WITH_SAME_ID_IS_ALREADY_RUNNING)
(query: SELECT sleepEachRow(3) FROM system.zeros FORMAT Null SETTINGS max_block_size=1)
```
