Skip to content

Commit c02e4e5

Browse files
vitarbsarthakaggarwal97
authored andcommitted
Add retries on CLUSTERDOWN in tests and fix sanitizer error
Signed-off-by: Viktor Söderqvist <[email protected]>
1 parent 9844cef commit c02e4e5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/functions.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ static void engineLibraryDispose(dict *d, void *obj) {
159159
engineLibraryFree(obj);
160160
}
161161

162+
/* Wrapper to free a library when used as a list free callback */
163+
static void engineLibraryListFree(void *obj) {
164+
engineLibraryFree(obj);
165+
}
166+
162167
/* Clear all the functions from the given library ctx */
163168
void functionsLibCtxClear(functionsLibCtx *lib_ctx) {
164169
dictEmpty(lib_ctx->functions, NULL);
@@ -338,7 +343,7 @@ libraryJoin(functionsLibCtx *functions_lib_ctx_dst, functionsLibCtx *functions_l
338343
} else {
339344
if (!old_libraries_list) {
340345
old_libraries_list = listCreate();
341-
listSetFreeMethod(old_libraries_list, (void (*)(void *))engineLibraryFree);
346+
listSetFreeMethod(old_libraries_list, engineLibraryListFree);
342347
}
343348
libraryUnlink(functions_lib_ctx_dst, old_li);
344349
listAddNodeTail(old_libraries_list, old_li);

tests/support/cluster.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ proc ::valkey_cluster::__dispatch__ {id method args} {
230230
if {[catch {$link $method {*}$args} e]} {
231231
if {$link eq {} || \
232232
[string range $e 0 4] eq {MOVED} || \
233-
[string range $e 0 2] eq {I/O} \
233+
[string range $e 0 2] eq {I/O} || \
234+
[string range $e 0 10] eq {CLUSTERDOWN} \
234235
} {
235236
# MOVED redirection.
236237
::valkey_cluster::__method__refresh_nodes_map $id

0 commit comments

Comments
 (0)