diff --git a/redis.conf b/redis.conf index 424dfa09a..31655e92e 100644 --- a/redis.conf +++ b/redis.conf @@ -1538,8 +1538,11 @@ notify-keyspace-events "" # # So use the 'requirepass' option to protect your instance. # -# To enable Gopher support uncomment the following line and set -# the option from no (the default) to yes. +# Note that Gopher is not currently supported when 'io-threads-do-reads' +# is enabled. +# +# To enable Gopher support, uncomment the following line and set the option +# from no (the default) to yes. # # gopher-enabled no @@ -1879,4 +1882,3 @@ jemalloc-bg-thread yes # # Set bgsave child process to cpu affinity 1,10,11 # bgsave_cpulist 1,10-11 - diff --git a/src/networking.c b/src/networking.c index 4cbddb660..7e97e4d31 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1919,8 +1919,9 @@ void processInputBuffer(client *c) { if (c->reqtype == PROTO_REQ_INLINE) { if (processInlineBuffer(c) != C_OK) break; /* If the Gopher mode and we got zero or one argument, process - * the request in Gopher mode. */ - if (server.gopher_enabled && + * the request in Gopher mode. To avoid data race, Redis won't + * support Gopher if enable io threads to read queries. */ + if (server.gopher_enabled && !server.io_threads_do_reads && ((c->argc == 1 && ((char*)(c->argv[0]->ptr))[0] == '/') || c->argc == 0)) {