From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3AC55445320 for ; Tue, 21 Jul 2020 00:11:41 +0300 (MSK) From: Vladislav Shpilevoy Date: Mon, 20 Jul 2020 23:11:39 +0200 Message-Id: <917bd68fb91e1d113c65a2c74013371f379243a5.1595279482.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/1] txn_limbo: use fiber_clock() instead of fiber_time() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com box.ctl.clear_synchro_queue() used fiber_time() instead of fiber_clock() to wait for a timeout. This is wrong, fiber_time() is realtime, not suitable for relative timeouts. For that purpose always should be used monotonic clock. The patch fixes that. Follow up #4849 --- Branch: http://github.com/tarantool/tarantool/tree/gerold103/qsync-fiber_clock Issue: https://github.com/tarantool/tarantool/issues/4849 src/box/box.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index 7a7befc32..45340df2e 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -960,9 +960,9 @@ box_clear_synchro_queue(void) /* Wait until pending confirmations/rollbacks reach us. */ double timeout = 2 * replication_synchro_timeout; - double start_tm = fiber_time(); + double start_tm = fiber_clock(); while (!txn_limbo_is_empty(&txn_limbo)) { - if (fiber_time() - start_tm > timeout) + if (fiber_clock() - start_tm > timeout) break; fiber_sleep(0.001); } -- 2.21.1 (Apple Git-122.3)