tarantool / tarantool/tarantool
Timeouts slip if there are no yields for a long time
@nshy is already working on this.
Since Oct 13, 2023.
- Dominant language
- Lua
- Stars
- 3.7k
- Forks
- 419
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 88
Description
Suppose current fiber does not yield for a time T1. If it arms a timer using ev_timer to trigger in time T2 then timer will trigger in T2 - T1 time instead of T2 in the best case (fiber yields right after arming the timer and there are no other fibers). The issue is ev updates its current time (mn_now) only when when it grabs control back. So in the above situation at the time of arming the current time is T1 behind "real time".
There is ev_now_update to update ev current time at any moment.
Idea: call ev_now_update in low resolution timer.
The slip was observed on attempt to add debug ASAN workflow to CI in PR https://github.com/tarantool/tarantool-ee/pull/572. The time slip for debug ASAN build is about 0.3 sec at the moment Tarantool run etcd configuration code on startup. This caused etcd-client/config_etcd_test.lua test to fail because the timeout for reply from etcd is set to 0.3 sec too and time slip cause the timeout to trigger immediately.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.