From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 32E106F3C4; Tue, 11 May 2021 00:40:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 32E106F3C4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1620682809; bh=nFs1hnGifTkXrHZ09zSJT+gzBH9S0amuUpoTdKQPW6g=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=mUdAOgq2jpkX86YddlqPKaDBUAChdX0r1plMvAUYpHA1gXgMzgAefkKm5SYfop5IO sBR/UxWqIAWq+nMiEmXIRLEl7pT2L09Ci39JSX3pxK9BhWFMig3sFbhkShbRAQt/zm ILZIz3bg4jp5pda+4CthQxru2f+6Bde0p1L6SYCA= Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 450526F3C4 for ; Tue, 11 May 2021 00:40:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 450526F3C4 Received: by mail-lf1-f43.google.com with SMTP id x20so25573260lfu.6 for ; Mon, 10 May 2021 14:40:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ngrXU4PzsVuXCyzvkUGwj/mf/NBBzrDrrV7JLlHgCZU=; b=HGCpJnogSkTsITK0qkvG2CcvA4t8+iXCBQaEI2tQ/AgmvMbkktts24JmqNBNn/eFXe EclwXZ2G27wrRjtXgMAS3oFJVdM2nmzYdSxN9emJ/zqwQAwtJABLG5UI4+Vkkkvv3BdW DSBqA2vM+/He/rthrLPNf823WEnSPbUw8gmzF2mFeI3unG/eCtTws6ofxS1m3G6ymIhv nIRmNRQ28nsfJ0cmc3Mc7RS1TSnVCNeX4Pdub+vKv15yOLMJ7M2ZIHecOBuitUi+f+3E PK8hTf81GntGAAyw/R5oyfwtO8QUs8fngKcKylnVhWqfC8lXhgJjlLQ4FsSrdEdMJQ6R UXJQ== X-Gm-Message-State: AOAM531VzQthuU4DkiKR7O0JwyXpuPNHan4jT9uvSDEz/ZKVKPIGx10h SwAmV8ZiWFYt5QXlwuG/aEVINcI5xTg= X-Google-Smtp-Source: ABdhPJz6togW3535zLSEyzQMvBf/fAps7nWfxd4a/hMyNj3Hk6zSi3oTESt2pxe+SRz1kboDbFODMg== X-Received: by 2002:ac2:52a9:: with SMTP id r9mr18739449lfm.308.1620682806776; Mon, 10 May 2021 14:40:06 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id p8sm1619207lfe.224.2021.05.10.14.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 14:40:05 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 907945A0019; Tue, 11 May 2021 00:40:04 +0300 (MSK) Date: Tue, 11 May 2021 00:40:04 +0300 To: Vladislav Shpilevoy Message-ID: References: <20210504155819.290874-1-gorcunov@gmail.com> <20210504155819.290874-2-gorcunov@gmail.com> <8901a085-c259-29d5-70e5-fa23c8123590@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8901a085-c259-29d5-70e5-fa23c8123590@tarantool.org> User-Agent: Mutt/2.0.6 (2021-03-06) Subject: Re: [Tarantool-patches] [PATCH v3 01/10] fiber: use uint64_t for fiber IDs X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: tml Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Mon, May 10, 2021 at 08:40:19PM +0200, Vladislav Shpilevoy wrote: > Hi! Thanks for the patch! > > See 5 comments below. Thanks! A fixup on top. --- changelogs/unreleased/gh-5846-cformat.md | 6 +++--- changelogs/unreleased/gh-5846-fiber-id.md | 4 ++-- src/lib/core/say.c | 2 +- src/lua/fiber.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/changelogs/unreleased/gh-5846-cformat.md b/changelogs/unreleased/gh-5846-cformat.md index 027de35d7..6ebbde126 100644 --- a/changelogs/unreleased/gh-5846-cformat.md +++ b/changelogs/unreleased/gh-5846-cformat.md @@ -1,8 +1,8 @@ ## bugfix/core - * Fixed wrong type specificator when printing fiber state - change which lead to negative fiber's ID logging. + * Fixed wrong type specification when printing fiber state + change which lead to negative fiber's ID logging (gh-5846). - For exmaple + For example ``` main/-244760339/cartridge.failover.task I> Instance state changed ``` diff --git a/changelogs/unreleased/gh-5846-fiber-id.md b/changelogs/unreleased/gh-5846-fiber-id.md index b645da849..aa8af536f 100644 --- a/changelogs/unreleased/gh-5846-fiber-id.md +++ b/changelogs/unreleased/gh-5846-fiber-id.md @@ -1,4 +1,4 @@ -## feature/core +## bugfix/core * Fiber IDs are switched to monotonically increasing unsigned 8 byte integers so that there won't be IDs wrapping anymore. This allows - to detect fiber's precedence by their IDs if needed. + to detect fiber's precedence by their IDs if needed (gh-5846). diff --git a/src/lib/core/say.c b/src/lib/core/say.c index 5307767b5..e0738de85 100644 --- a/src/lib/core/say.c +++ b/src/lib/core/say.c @@ -792,7 +792,7 @@ say_format_plain_tail(char *buf, int len, int level, const char *filename, if (cord) { SNPRINT(total, snprintf, buf, len, " %s", cord->name); if (fiber() && fiber()->fid != FIBER_ID_SCHED) { - SNPRINT(total, snprintf, buf, len, "/%lld/%s", + SNPRINT(total, snprintf, buf, len, "/%llu/%s", (long long)fiber()->fid, fiber_name(fiber())); } diff --git a/src/lua/fiber.c b/src/lua/fiber.c index c792bf385..eb6bcc612 100644 --- a/src/lua/fiber.c +++ b/src/lua/fiber.c @@ -159,7 +159,7 @@ lbox_checkfiber(struct lua_State *L, int index) if (lua_type(L, index) == LUA_TNUMBER) { fid = luaL_touint64(L, index); } else { - fid = *(uint64_t *) luaL_checkudata(L, index, fiberlib_name); + fid = *(uint64_t *)luaL_checkudata(L, index, fiberlib_name); } struct fiber *f = fiber_find(fid); if (f == NULL) @@ -174,7 +174,7 @@ lbox_fiber_id(struct lua_State *L) if (lua_gettop(L) == 0) fid = fiber()->fid; else - fid = *(uint64_t *) luaL_checkudata(L, 1, fiberlib_name); + fid = *(uint64_t *)luaL_checkudata(L, 1, fiberlib_name); luaL_pushuint64(L, fid); return 1; } -- 2.31.1