From 251a46861b2667eeea8dd9636030ce6429cde466 Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 15 Apr 2020 23:19:05 -0400 Subject: [PATCH 1/2] update TLS readme for KeyDB Former-commit-id: 3f5d3fec36b15476f52ad683af786dd7ee1268ff --- TLS.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/TLS.md b/TLS.md index e480c1e9d..ae1a066db 100644 --- a/TLS.md +++ b/TLS.md @@ -51,19 +51,7 @@ Connections All socket operations now go through a connection abstraction layer that hides I/O and read/write event handling from the caller. -**Multi-threading I/O is not currently supported for TLS**, as a TLS connection -needs to do its own manipulation of AE events which is not thread safe. The -solution is probably to manage independent AE loops for I/O threads and longer -term association of connections with threads. This may potentially improve -overall performance as well. - -Sync IO for TLS is currently implemented in a hackish way, i.e. making the -socket blocking and configuring socket-level timeout. This means the timeout -value may not be so accurate, and there would be a lot of syscall overhead. -However I believe that getting rid of syncio completely in favor of pure async -work is probably a better move than trying to fix that. For replication it would -probably not be so hard. For cluster keys migration it might be more difficult, -but there are probably other good reasons to improve that part anyway. +Note that unlike Redis, KeyDB fully supports multithreading of TLS connections. To-Do List ---------- From 158868ed92591f935f97fee118461fdccc5c00a6 Mon Sep 17 00:00:00 2001 From: John Sully Date: Thu, 16 Apr 2020 17:06:25 -0400 Subject: [PATCH 2/2] quiet TSAN in serverLog Former-commit-id: a836d5947d5a024d855bf5d0d6269e014e47b868 --- src/server.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index 0212547cf..c1966f968 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1077,7 +1077,9 @@ void serverLogRaw(int level, const char *msg) { gettimeofday(&tv,NULL); struct tm tm; - nolocks_localtime(&tm,tv.tv_sec,g_pserver->timezone,g_pserver->daylight_active); + int daylight_active; + __atomic_load(&g_pserver->daylight_active, &daylight_active, __ATOMIC_RELAXED); + nolocks_localtime(&tm,tv.tv_sec,g_pserver->timezone,daylight_active); off = strftime(buf,sizeof(buf),"%d %b %Y %H:%M:%S.",&tm); snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000); if (g_pserver->sentinel_mode) { @@ -1777,7 +1779,7 @@ void updateCachedTime(int update_daylight_info) { struct tm tm; time_t ut = g_pserver->unixtime; localtime_r(&ut,&tm); - g_pserver->daylight_active = tm.tm_isdst; + __atomic_store(&g_pserver->daylight_active, &tm.tm_isdst, __ATOMIC_RELAXED); } }