Merge commit 'c57d9146f41f4b661d9d2cb48b83b3abc757ba0e' into unstable

Former-commit-id: d74871da40dea11bd1a226fbecb0974ff5f8ec8c
This commit is contained in:
John Sully 2020-05-22 15:36:44 -04:00
commit 1eeb5de69f
6 changed files with 87 additions and 21 deletions

48
.github/workflows/daily.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Daily
on:
schedule:
- cron: '0 7 * * *'
jobs:
test-jemalloc:
runs-on: ubuntu-latest
timeout-minutes: 1200
steps:
- uses: actions/checkout@v1
- name: make
run: make
- name: test
run: |
sudo apt-get install tcl8.5
./runtest --accurate --verbose
- name: module api test
run: ./runtest-moduleapi --verbose
test-libc-malloc:
runs-on: ubuntu-latest
timeout-minutes: 1200
steps:
- uses: actions/checkout@v1
- name: make
run: make MALLOC=libc
- name: test
run: |
sudo apt-get install tcl8.5
./runtest --accurate --verbose
- name: module api test
run: ./runtest-moduleapi --verbose
test-valgrind:
runs-on: ubuntu-latest
timeout-minutes: 14400
steps:
- uses: actions/checkout@v1
- name: make
run: make valgrind
- name: test
run: |
sudo apt-get install tcl8.5 valgrind -y
./runtest --valgrind --verbose --clients 1
- name: module api test
run: ./runtest-moduleapi --valgrind --verbose --clients 1

View File

@ -1726,7 +1726,7 @@ void enableWatchdog(int period) {
/* Watchdog was actually disabled, so we have to setup the signal /* Watchdog was actually disabled, so we have to setup the signal
* handler. */ * handler. */
sigemptyset(&act.sa_mask); sigemptyset(&act.sa_mask);
act.sa_flags = SA_ONSTACK | SA_SIGINFO; act.sa_flags = SA_SIGINFO;
act.sa_sigaction = watchdogSignalHandler; act.sa_sigaction = watchdogSignalHandler;
sigaction(SIGALRM, &act, NULL); sigaction(SIGALRM, &act, NULL);
} }

View File

@ -1523,7 +1523,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, uint64_t mvcc_tstamp) {
/* Load every single element of the list */ /* Load every single element of the list */
while(len--) { while(len--) {
if ((ele = rdbLoadEncodedStringObject(rdb)) == NULL) return NULL; if ((ele = rdbLoadEncodedStringObject(rdb)) == NULL) {
decrRefCount(o);
return NULL;
}
dec = getDecodedObject(ele); dec = getDecodedObject(ele);
size_t len = sdslen(szFromObj(dec)); size_t len = sdslen(szFromObj(dec));
quicklistPushTail((quicklist*)ptrFromObj(o), ptrFromObj(dec), len); quicklistPushTail((quicklist*)ptrFromObj(o), ptrFromObj(dec), len);
@ -1550,8 +1553,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, uint64_t mvcc_tstamp) {
long long llval; long long llval;
sds sdsele; sds sdsele;
if ((sdsele = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) if ((sdsele = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL) {
== NULL) return NULL; decrRefCount(o);
return NULL;
}
if (o->encoding == OBJ_ENCODING_INTSET) { if (o->encoding == OBJ_ENCODING_INTSET) {
/* Fetch integer value from element. */ /* Fetch integer value from element. */
@ -1590,16 +1595,20 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, uint64_t mvcc_tstamp) {
double score; double score;
zskiplistNode *znode; zskiplistNode *znode;
if ((sdsele = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) if ((sdsele = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL) {
== NULL) return NULL; decrRefCount(o);
return NULL;
}
if (rdbtype == RDB_TYPE_ZSET_2) { if (rdbtype == RDB_TYPE_ZSET_2) {
if (rdbLoadBinaryDoubleValue(rdb,&score) == -1) { if (rdbLoadBinaryDoubleValue(rdb,&score) == -1) {
decrRefCount(o);
sdsfree(sdsele); sdsfree(sdsele);
return NULL; return NULL;
} }
} else { } else {
if (rdbLoadDoubleValue(rdb,&score) == -1) { if (rdbLoadDoubleValue(rdb,&score) == -1) {
decrRefCount(o);
sdsfree(sdsele); sdsfree(sdsele);
return NULL; return NULL;
} }
@ -1634,15 +1643,12 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, uint64_t mvcc_tstamp) {
while (o->encoding == OBJ_ENCODING_ZIPLIST && len > 0) { while (o->encoding == OBJ_ENCODING_ZIPLIST && len > 0) {
len--; len--;
/* Load raw strings */ /* Load raw strings */
if ((field = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) if ((field = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL) {
== NULL)
{
decrRefCount(o); decrRefCount(o);
return NULL; return NULL;
} }
if ((value = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) if ((value = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL) {
== NULL) sdsfree(field);
{
decrRefCount(o); decrRefCount(o);
return NULL; return NULL;
} }
@ -1673,15 +1679,12 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, uint64_t mvcc_tstamp) {
while (o->encoding == OBJ_ENCODING_HT && len > 0) { while (o->encoding == OBJ_ENCODING_HT && len > 0) {
len--; len--;
/* Load encoded strings */ /* Load encoded strings */
if ((field = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) if ((field = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL) {
== NULL)
{
decrRefCount(o); decrRefCount(o);
return NULL; return NULL;
} }
if ((value = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) if ((value = (sds)rdbGenericLoadStringObject(rdb,RDB_LOAD_SDS,NULL)) == NULL) {
== NULL) sdsfree(field);
{
decrRefCount(o); decrRefCount(o);
return NULL; return NULL;
} }
@ -1704,7 +1707,10 @@ robj *rdbLoadObject(int rdbtype, rio *rdb, sds key, uint64_t mvcc_tstamp) {
while (len--) { while (len--) {
unsigned char *zl = (unsigned char*) unsigned char *zl = (unsigned char*)
rdbGenericLoadStringObject(rdb,RDB_LOAD_PLAIN,NULL); rdbGenericLoadStringObject(rdb,RDB_LOAD_PLAIN,NULL);
if (zl == NULL) return NULL; if (zl == NULL) {
decrRefCount(o);
return NULL;
}
quicklistAppendZiplist((quicklist*)ptrFromObj(o), zl); quicklistAppendZiplist((quicklist*)ptrFromObj(o), zl);
} }
} else if (rdbtype == RDB_TYPE_HASH_ZIPMAP || } else if (rdbtype == RDB_TYPE_HASH_ZIPMAP ||

View File

@ -440,7 +440,7 @@ unsigned int zipStorePrevEntryLength(unsigned char *p, unsigned int len) {
if ((prevlensize) == 1) { \ if ((prevlensize) == 1) { \
(prevlen) = (ptr)[0]; \ (prevlen) = (ptr)[0]; \
} else if ((prevlensize) == 5) { \ } else if ((prevlensize) == 5) { \
assert(sizeof((prevlen)) == 4); \ assert(sizeof((prevlen)) == 4); \
memcpy(&(prevlen), ((char*)(ptr)) + 1, 4); \ memcpy(&(prevlen), ((char*)(ptr)) + 1, 4); \
memrev32ifbe(&prevlen); \ memrev32ifbe(&prevlen); \
} \ } \

View File

@ -54,6 +54,12 @@ tags {"aof"} {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls] set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls]
wait_for_condition 50 100 {
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
test "Truncated AOF loaded: we expect foo to be equal to 5" { test "Truncated AOF loaded: we expect foo to be equal to 5" {
assert {[$client get foo] eq "5"} assert {[$client get foo] eq "5"}
} }
@ -71,6 +77,12 @@ tags {"aof"} {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls] set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls]
wait_for_condition 50 100 {
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
test "Truncated AOF loaded: we expect foo to be equal to 6 now" { test "Truncated AOF loaded: we expect foo to be equal to 6 now" {
assert {[$client get foo] eq "6"} assert {[$client get foo] eq "6"}
} }

View File

@ -118,7 +118,7 @@ start_server {tags {"repl"}} {
# correctly the RDB file: such file will contain "lua" AUX # correctly the RDB file: such file will contain "lua" AUX
# sections with scripts already in the memory of the master. # sections with scripts already in the memory of the master.
wait_for_condition 50 100 { wait_for_condition 500 100 {
[s -1 master_link_status] eq {up} [s -1 master_link_status] eq {up}
} else { } else {
fail "Replication not started." fail "Replication not started."