tarantool / tarantool/tarantool

Timeouts slip if there are no yields for a long time

Open
#9,261 1 comment 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.