From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.mail.ru (smtp1.mail.ru [94.100.179.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 1D9EB469719 for ; Tue, 3 Mar 2020 02:29:56 +0300 (MSK) From: Vladislav Shpilevoy Date: Tue, 3 Mar 2020 00:29:50 +0100 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 0/3] fio: close unused descriptors automatically List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, korablev@tarantool.org The patchset introduces a fiber worker singleton object and uses it for garbage collection of fio and SWIM objects. This is a workaround for inability to yield in ffi.gc hook, which is used by fio and SWIM. SWIM had GC before, but it was creating a new fiber for each GC. Fio didn't have GC. Branch: http://github.com/tarantool/tarantool/tree/gerold103/gh-4727-fio-gc Issue: https://github.com/tarantool/tarantool/issues/4727 @ChangeLog - fio descriptors are closed on garbage collection (gh-4727). Changes in V2: - Added a special single fiber for garbage collection of objects, which yield in their destructors. Vladislav Shpilevoy (3): fiber: introduce schedule_task() internal function fio: close unused descriptors automatically swim: use fiber._internal.schedule_task() for GC src/lua/fiber.c | 15 +++++ src/lua/fiber.lua | 60 ++++++++++++++++++ src/lua/fio.lua | 34 ++++++++-- src/lua/swim.lua | 11 ++-- test/app/fiber.result | 72 +++++++++++++++++++++ test/app/fiber.test.lua | 41 ++++++++++++ test/app/gh-4727-fio-gc.result | 104 +++++++++++++++++++++++++++++++ test/app/gh-4727-fio-gc.test.lua | 60 ++++++++++++++++++ 8 files changed, 385 insertions(+), 12 deletions(-) create mode 100644 test/app/gh-4727-fio-gc.result create mode 100644 test/app/gh-4727-fio-gc.test.lua -- 2.21.1 (Apple Git-122.3)