[Tarantool-patches] [PATCH v1] Output for sockets issues cuts its names in logs

Alexander V. Tikhonov avtikhon at tarantool.org
Sun Aug 16 23:58:43 MSK 2020


Found issue in log files:

  2020-08-10 11:47:07.191 [73298] iproto sio.c:268 !> SystemError writev(1), called on fd 31, aka unix/:/Users/tntmac01.tarantool.i/tnt/test/var/001_r: Broken pipe

when it cut the socket name. The length of the socket name based on:

  src/lib/core/sio.h:enum { SERVICE_NAME_MAXLEN = 32 };
  src/lib/core/sio.c:	int name_size = 2 * SERVICE_NAME_MAXLEN;

Decided to increase multiplication of the name_size from 2 to 4.

Closes #5246
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5246-logs-output-length
Issue: https://github.com/tarantool/tarantool/issues/5246

 src/lib/core/sio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/core/sio.c b/src/lib/core/sio.c
index 97a512eee..631f792e8 100644
--- a/src/lib/core/sio.c
+++ b/src/lib/core/sio.c
@@ -51,7 +51,7 @@ sio_socketname(int fd)
 {
 	/* Preserve errno */
 	int save_errno = errno;
-	int name_size = 2 * SERVICE_NAME_MAXLEN;
+	int name_size = 4 * SERVICE_NAME_MAXLEN;
 	char *name = static_alloc(name_size);
 	int n = snprintf(name, name_size, "fd %d", fd);
 	if (fd >= 0) {
-- 
2.17.1



More information about the Tarantool-patches mailing list