ClickHouse® is a real-time analytics DBMS
Go to file
Azat Khuzhin 630eddbbbc Disable forwarding signals by watchdog in systemd service
With default KillMode=control-group, systemd will send signals to all
processes in cgroup and this will lead to server will be terminated
forcefully due to double signal.

    2023.09.19 12:47:06.369090 [ 763 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 12:47:06.369141 [ 762 ] {} <Debug> Application: Received termination signal.
    2023.09.19 12:47:06.369215 [ 763 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 12:47:06.369225 [ 763 ] {} <Information> Application: This is the second termination signal. Immediately terminate.
    2023.09.19 12:47:06.400959 [ 761 ] {} <Information> Application: Child process exited normally with code 143.

Someone may naively think that, hey, I can change KillMode to
process/mixed, but this will not work either, because in this case
systemd cannot wait for the $MainPID (and main_pid_alien=true in
systemd's sources), because it is not a child of systemd, and this will
lead to double signal again:

    2023.09.19 16:24:19.694473 [ 3118 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 16:24:19.694894 [ 3118 ] {} <Information> Application: Received termination signal (Terminated)
    2023.09.19 16:24:19.695060 [ 3118 ] {} <Information> Application: This is the second termination signal. Immediately terminate.

And this is because it sends signal firstly on a normal termnation and
then when it cleans up left over processes:

    clickhouse-server.service: Found left-over process 3117 (clickhouse-serv) in control group while starting unit. Ignoring.

And yes, even though it prints "Ignoring" here (I guess it is related to
the fact that it can be ignored if the signal will not be handled)

Here is a proof of double signal by systemd:

    # pgrep clickhouse-serv | xargs strace  -e /kill -fp
    strace: Process 3117 attached with 469 threads
    [pid  3582] --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
    [pid  3580] --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
    [pid  3582] --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=1, si_uid=0} ---
    [pid  3580] --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1, si_uid=0} ---
                                                                      ^^^
    [pid  3118] tgkill(3117, 3118, SIGTERM) = 0 # and this is a force termination

So yes, there is no other way except for disabling signal forwarding.

*Well, there is another way, but I guess it is will be unwelcome (even
though systemd can be configured in multiple ways right now, and there
is even systemd-oomd instead of clickhouse'es watchdog) - disable
watchdog completelly.*

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-09-19 22:09:38 +02:00
.github Temporarily disable cron 2023-09-14 15:09:42 +00:00
base AARCH64 Neon memequal wide 2023-08-20 12:45:18 +03:00
benchmark Remove old file 2022-07-12 20:28:02 +02:00
cmake Fix strange message 2023-09-11 05:35:15 +02:00
contrib Merge pull request #54646 from rschu1ze/bump-abseil 2023-09-18 09:44:35 +02:00
docker Merge pull request #54675 from ClickHouse/disable-apk-packages 2023-09-15 18:20:19 +02:00
docs Merge pull request #54789 from rschu1ze/docs-qc2 2023-09-19 13:32:02 +02:00
packages Disable forwarding signals by watchdog in systemd service 2023-09-19 22:09:38 +02:00
programs Document shutdown_wait_unfinished/shutdown_wait_unfinished_queries in config.xml 2023-09-19 22:09:38 +02:00
rust Use sccache for rust builds 2023-08-10 22:09:20 +02:00
src Add ability to disable forwarding signals to the child by watchdog 2023-09-19 22:09:38 +02:00
tests Revert "Fix filtering parts with indexHint for non analyzer" 2023-09-19 21:39:21 +02:00
utils Merge pull request #54642 from rschu1ze/broken-re2st 2023-09-17 15:30:57 +02:00
.clang-format clang-format: Disable namespace indentation and omit {} in if/for/while 2023-09-12 19:20:22 +00:00
.clang-tidy readability-identifier-names: adjust invalid options 2023-05-13 20:28:55 +00:00
.clangd Enable few slow clang-tidy checks for clangd 2023-05-13 14:08:25 +02:00
.editorconfig Changed tabs to spaces in editor configs and in style guide [#CLICKHOUSE-3]. 2017-04-01 11:35:09 +03:00
.exrc Fix vim settings (wrong group for autocmd) 2022-12-03 21:23:24 +01:00
.git-blame-ignore-revs Add files with revision to ignore for git blame 2022-09-13 23:05:56 +02:00
.gitattributes Ignore core.autocrlf for tests references 2022-10-05 09:13:27 +02:00
.gitignore Reproducible builds for Rust 2023-07-22 22:46:22 +02:00
.gitmodules aklomp-base64: fix the submodule name 2023-09-07 08:08:02 +00:00
.pylintrc Cover deprecated bad-* pylint options with black 2022-06-08 14:18:28 +02:00
.snyk Add exclusions from the Snyk scan 2022-10-31 17:47:02 +01:00
.yamllint Increase line-length limit for yamlllint 2023-06-13 19:45:51 +02:00
AUTHORS Update AUTHORS 2021-09-22 11:38:03 +03:00
CHANGELOG.md Address TODO in Changelog 2023-08-31 21:01:23 +02:00
CMakeLists.txt fix fuzzers, cmake refactor, add target fuzzers 2023-09-01 14:20:50 +00:00
CODE_OF_CONDUCT.md Add minimal code of conduct #9676 2020-03-16 12:44:28 +03:00
CONTRIBUTING.md Mention ClickHouse CLA in CONTRIBUTING.md (#32697) 2021-12-14 03:47:19 +03:00
format_sources allow several <graphite> targets (#603) 2017-03-21 23:08:09 +04:00
LICENSE Update LICENSE 2023-01-02 00:35:32 +01:00
PreLoad.cmake Revert "Check what will happen if we build ClickHouse with Musl" 2023-09-04 22:01:10 +02:00
README.md Update README.md 2023-08-06 21:46:06 +02:00
SECURITY.md Update version_date.tsv and changelogs after v23.8.1.2992-lts 2023-09-01 16:00:28 +00:00

ClickHouse — open source distributed column-oriented DBMS

ClickHouse® is an open-source column-oriented database management system that allows generating analytical data reports in real-time.

How To Install (Linux, macOS, FreeBSD)

curl https://clickhouse.com/ | sh

Upcoming Events

Also, keep an eye out for upcoming meetups around the world. Somewhere else you want us to be? Please feel free to reach out to tyler clickhouse com.

Recent Recordings

  • Recent Meetup Videos: Meetup Playlist Whenever possible recordings of the ClickHouse Community Meetups are edited and presented as individual talks. Current featuring "Modern SQL in 2023", "Fast, Concurrent, and Consistent Asynchronous INSERTS in ClickHouse", and "Full-Text Indices: Design and Experiments"
  • Recording available: v23.6 Release Webinar All the features of 23.6, one convenient video! Watch it now!
  • All release webinar recordings: YouTube playlist

Interested in joining ClickHouse and making it your full-time job?

We are a globally diverse and distributed team, united behind a common goal of creating industry-leading, real-time analytics. Here, you will have an opportunity to solve some of the most cutting-edge technical challenges and have direct ownership of your work and vision. If you are a contributor by nature, a thinker and a doer - well definitely click!

Check out our current openings here: https://clickhouse.com/company/careers

Cant find what you are looking for, but want to let us know you are interested in joining ClickHouse? Email careers@clickhouse.com!