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 5142570368; Tue, 23 Feb 2021 23:41:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5142570368 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614112910; bh=TuiGEWSZD8PsE3WXUG0hRMJRfHdQ+abs4YvqUzjKncg=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=DxPCXzZKML1gF2/7SCU1G7bSjX/lI8R81DkSEJArpIG73tjYOdQLVFJXzyoCIecM1 4YF6169J06XR//y+VoazwHTaX0AoGbYeESj6Pm0zqU/4HknRd1Z5AOXbfTsTFfWjBt f8izVKrqaE5GQYzJR1QdXjmsD6BPOfcAEl5cNVlg= Received: from smtp59.i.mail.ru (smtp59.i.mail.ru [217.69.128.39]) (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 66AF070368 for ; Tue, 23 Feb 2021 23:41:48 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 66AF070368 Received: by smtp59.i.mail.ru with esmtpa (envelope-from ) id 1lEeV9-00031P-C2; Tue, 23 Feb 2021 23:41:47 +0300 To: Cyrill Gorcunov , tml References: <20210222182030.76232-1-gorcunov@gmail.com> Message-ID: <41811c65-448c-0de6-68cd-6a64779ca283@tarantool.org> Date: Tue, 23 Feb 2021 21:41:46 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210222182030.76232-1-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD975C3EC174F56692254B0AABE1FB071B2BA6557555153D6A0182A05F538085040898195045227F64EE8FD952F77C1EEEDADA322B051186A0CB0B8D63FED9B7A4F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AC43A7B4C36B769DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374FA524FBD8B89EAA8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC511C571022D431D164360BA83D179F1F25EC1B4CC2ECA43F389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0A3E989B1926288338941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6D52CD31C43BF465FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249AECFD3D254B7B97C76E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8BC899C4B0487787E7D81D268191BDAD3D698AB9A7B718F8C442539A7722CA490C13377AFFFEAFD26923F8577A6DFFEA7CB24F08513AFFAC7993EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B6816F06BAE7E44B0A089D37D7C0E48F6C5571747095F342E857739F23D657EF2B6825BDBE14D8E7025EC15B47EAE72BACBD9CCCA9EDD067B1EDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E923155C0AF1600DCBC20BDD0D5C1FF1EAB3C3403C3B868D2C8096 X-C1DE0DAB: 0D63561A33F958A5C4F734B500E1BD42715F98EBC4327674054B31A2A46EAE8ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75968C9853642EB7C3410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34728AF701C68E4539E9DAB4E8A9DBD6C3523B589B8B645969D0B6EAAC6375A5A98E8292DAE19A7E691D7E09C32AA3244CC26B086DC60D6048D7F2B9BD04B1F6D597FE24653F78E668FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyK6JYJ15DtKmJlAyBPeiFw== X-Mailru-Sender: 504CC1E875BF3E7D9BC0E5172ADA3110AB034B0CAF74C13156A5E96155A2AD1FECCF3107917BC8C007784C02288277CA03E0582D3806FB6A5317862B1921BA260ED6CFD6382C13A6112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] say: fix format for fiber()->fid 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Please, add a changelog file. This is user-visible behaviour so it must be reflected in the changes. On 22.02.2021 19:20, Cyrill Gorcunov wrote: > The fiber's ID (fiber::fid) is unsigned integer so > we should use a proper format specificator when printing > it out, otherwise the logger show us weird strings like > > | main/-244760339/cartridge.failover.task I> Instance state changed > > Fixes #5846 > > Signed-off-by: Cyrill Gorcunov > --- > src/lib/core/say.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/lib/core/say.c b/src/lib/core/say.c > index cbd10e107..6138752a7 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, "/%i/%s", > + SNPRINT(total, snprintf, buf, len, "/%u/%s", > fiber()->fid, fiber_name(fiber())); I remember we had some issues about %u not being compatible with uint32_t so we did manual casts to 'unsigned'. Not sure though what was the commit/ticket, or if it really happened. I am fine with not using the cast as long as all platforms and compilers build flawlessly. Also it is ok for me if you will add an explicit cast in the next version of the patch. Up to you. The same below. > } > } > @@ -918,7 +918,7 @@ say_format_json(struct log *log, char *buf, int len, int level, const char *file > SNPRINT(total, snprintf, buf, len, "\""); > if (fiber() && fiber()->fid != FIBER_ID_SCHED) { > SNPRINT(total, snprintf, buf, len, > - ", \"fiber_id\": %i, ", fiber()->fid); > + ", \"fiber_id\": %u, ", fiber()->fid); > SNPRINT(total, snprintf, buf, len, > "\"fiber_name\": \""); > SNPRINT(total, json_escape, buf, len, > > base-commit: 6610bce9bf43a139043518cd76d3c0c81c981ce2