Merge branch 'unstable' into keydbpro

Former-commit-id: 642719cef20a88d23af84a16d3f6757088c23b1a
This commit is contained in:
John Sully 2020-04-16 17:06:33 -04:00
commit 0962c5f366
2 changed files with 5 additions and 15 deletions

14
TLS.md
View File

@ -51,19 +51,7 @@ Connections
All socket operations now go through a connection abstraction layer that hides All socket operations now go through a connection abstraction layer that hides
I/O and read/write event handling from the caller. I/O and read/write event handling from the caller.
**Multi-threading I/O is not currently supported for TLS**, as a TLS connection Note that unlike Redis, KeyDB fully supports multithreading of TLS connections.
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.
To-Do List To-Do List
---------- ----------

View File

@ -1078,7 +1078,9 @@ void serverLogRaw(int level, const char *msg) {
gettimeofday(&tv,NULL); gettimeofday(&tv,NULL);
struct tm tm; 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); off = strftime(buf,sizeof(buf),"%d %b %Y %H:%M:%S.",&tm);
snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000); snprintf(buf+off,sizeof(buf)-off,"%03d",(int)tv.tv_usec/1000);
if (g_pserver->sentinel_mode) { if (g_pserver->sentinel_mode) {
@ -1886,7 +1888,7 @@ void updateCachedTime(int update_daylight_info) {
struct tm tm; struct tm tm;
time_t ut = g_pserver->unixtime; time_t ut = g_pserver->unixtime;
localtime_r(&ut,&tm); localtime_r(&ut,&tm);
g_pserver->daylight_active = tm.tm_isdst; __atomic_store(&g_pserver->daylight_active, &tm.tm_isdst, __ATOMIC_RELAXED);
} }
} }