Skip to content

[k2] increase timeouts precision - #1714

Merged
PetrShumilov merged 4 commits into
masterfrom
pshumilov/fix_curl_timeouts
Nov 12, 2026
Merged

PetrShumilov merged 4 commits into
masterfrom
pshumilov/fix_curl_timeouts

Conversation

@PetrShumilov

@PetrShumilov PetrShumilov commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor
Timeout value (seconds) Before fixes CURL After fixes CURL Before fixes RPC After fixes RPC
0.0005 Immediate false 1 ms 1 ms 1 ms
0.0019 Immediate false 2 ms 1 ms 2 ms
0.5 Immediate false 500 ms 500 ms 500 ms
1.001 1000 ms 1001 ms 1000 ms 1001 ms
1.5 1000 ms 1500 ms 1500 ms 1500 ms
-0.0005 Immediate false 24 h fallback 1 ms 1 ms
NaN Undefined behavior 24 h fallback Undefined behavior 300 ms default
+∞ Undefined behavior 24 h fallback Undefined behavior 24 h
-∞ Undefined behavior 24 h fallback Undefined behavior 1 ms
1e20 Undefined behavior 24 h fallback Undefined behavior 24 h

@PetrShumilov PetrShumilov added this to the next milestone Nov 12, 2026
@PetrShumilov PetrShumilov self-assigned this Nov 12, 2026
@PetrShumilov PetrShumilov added bug Something isn't working runtime Feature related to runtime k2 Affects compiler or runtime in K2 mode labels Nov 12, 2026
denisichh
denisichh previously approved these changes Nov 12, 2026

@denisichh denisichh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PetrShumilov PetrShumilov changed the title Increase curl timeouts precision up to milliseconds Increase timeouts precision Nov 12, 2026
@PetrShumilov
PetrShumilov force-pushed the pshumilov/fix_curl_timeouts branch from 9bb3259 to 892073e Compare November 12, 2026 13:38
Signed-off-by: Petr Shumilov <p.shumilov@vkteam.ru>
@PetrShumilov
PetrShumilov force-pushed the pshumilov/fix_curl_timeouts branch from 892073e to 2296582 Compare November 12, 2026 13:49
@PetrShumilov PetrShumilov changed the title Increase timeouts precision [k2] increase timeouts precision Nov 12, 2026
Clamp timeouts in floating-point seconds before rounding up to milliseconds.
Preserve the 300 ms default and the 1 ms to 24 hour bounds, and handle NaN
and infinities before any conversion to an integral duration.

Signed-off-by: Petr Shumilov <p.shumilov@vkteam.ru>
Extend the existing curl integration suite with a successful fractional
budget, the default fallback for a tiny negative timeout, and exact-zero
behavior. Keep the existing timeout failure case.

Signed-off-by: Petr Shumilov <p.shumilov@vkteam.ru>
@PetrShumilov
PetrShumilov force-pushed the pshumilov/fix_curl_timeouts branch from 2296582 to ba13824 Compare November 12, 2026 14:44
denisichh
denisichh previously approved these changes Nov 12, 2026

@denisichh denisichh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Petr Shumilov <p.shumilov@vkteam.ru>
@PetrShumilov
PetrShumilov force-pushed the pshumilov/fix_curl_timeouts branch from ccf3bb3 to cb69d3c Compare November 12, 2026 15:35
@PetrShumilov
PetrShumilov merged commit a7a8b12 into master Nov 12, 2026
6 of 8 checks passed
@PetrShumilov
PetrShumilov deleted the pshumilov/fix_curl_timeouts branch November 12, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working k2 Affects compiler or runtime in K2 mode runtime Feature related to runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants