From 5477593ce838f5377c0624559671bd3963628620 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Sun, 26 Jan 2025 11:43:38 +0800 Subject: [PATCH] log error on thread local hashtable exception --- src/connection_pool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/connection_pool.c b/src/connection_pool.c index 18431aa..970f0f1 100644 --- a/src/connection_pool.c +++ b/src/connection_pool.c @@ -762,6 +762,8 @@ int conn_pool_close_connection_ex(ConnectionPool *cp, htable = pthread_getspecific(cp->tls_key); if (htable == NULL) { + logError("file: "__FILE__", line: %d, " + "the thread local key NOT exist!", __LINE__); return close_connection(cp, conn, &key, hash_code, bForce); } @@ -791,6 +793,10 @@ int conn_pool_close_connection_ex(ConnectionPool *cp, } else { previous->next = node->next; } + } else { + logError("file: "__FILE__", line: %d, " + "%.*s NOT in the thread local hashtable!", + __LINE__, key.len, key.str); } return close_connection(cp, conn, &key, hash_code, bForce);