Skip to content

Fix overflow in Stopwatch#29811

Merged
Avogar merged 1 commit intomasterfrom
fix_overflow_in_stopwatch
Oct 7, 2021
Merged

Fix overflow in Stopwatch#29811
Avogar merged 1 commit intomasterfrom
fix_overflow_in_stopwatch

Conversation

@tavplubix
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehaviour in official stable or prestable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Avoid Timeout exceeded: elapsed 18446744073.709553 seconds error that might happen in extremely rare cases, presumably due to some bug in kernel. Fixes #29154.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Oct 6, 2021
@tavplubix
Copy link
Copy Markdown
Member Author

Functional stateless tests (thread) — Timeout - https://nda.ya.ru/t/lm8r0tkf4KYmHu
Integration tests (thread) - test_dictionaries_dependency - #29804
Stress test (thread) - Memory limit (total) exceeded: would use 140.31 GiB (attempt to allocate chunk of 2105374 bytes), maximum: 125.94 GiB on attempt to get running queries list

@Avogar Avogar self-assigned this Oct 7, 2021
@Avogar Avogar merged commit 1ac0381 into master Oct 7, 2021
@Avogar Avogar deleted the fix_overflow_in_stopwatch branch October 7, 2021 17:14
tavplubix added a commit that referenced this pull request Oct 11, 2021
Backport #29811 to 21.9: Fix overflow in Stopwatch
tavplubix added a commit that referenced this pull request Oct 11, 2021
Backport #29811 to 21.10: Fix overflow in Stopwatch
tavplubix added a commit that referenced this pull request Oct 11, 2021
Backport #29811 to 21.8: Fix overflow in Stopwatch
azat added a commit to azat/ClickHouse that referenced this pull request May 12, 2023
…tonic clock)

There is no bug in Linux, the issue that CLOCK_MONOTONIC returns values
less then previous calls likely happens due to adjtime(3) (NTP), since
CLOCK_MONOTONIC is affected by it, and I've seen lots of slight time
modifications due to NTP on the servers. And even on my desktop (I also
have NTP enabled):

    CLOCK_MONOTONIC:     189292.803 (2 days +  4h 34m 52s)
    CLOCK_MONOTONIC_RAW: 189290.016 (2 days +  4h 34m 50s)

However on Linux there is CLOCK_MONOTONIC_RAW, it is similar to
CLOCK_MONOTONIC, but does not affected by the adjtime(3).

About performance, it is the same:

    CLOCK_MONOTONIC 10e6:     real=0m0.191s user=0m0.190s sys=0m0.000s
    CLOCK_MONOTONIC_RAW 10e6: real=0m0.191s user=0m0.191s sys=0m0.000s

Ops/s:
- AMD Threadripper: 52.3e6
- Xeon Silver 4216 2.10: 46.5e6

Fixes: c5d631c
Fixes: ClickHouse#29811 (cc @tavplubix)
Signed-off-by: Azat Khuzhin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeout exceeded: elapsed 18446744073.709553 seconds

3 participants