[Tarantool-patches] [PATCH v3 01/10] fiber: use uint64_t for fiber IDs

Cyrill Gorcunov gorcunov at gmail.com
Tue May 11 00:40:04 MSK 2021


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



More information about the Tarantool-patches mailing list