Commit 94180837 authored by Wang Yuan's avatar Wang Yuan Committed by Oran Agra
Browse files

Don't support Gopher if enable io threads to read queries (#7851)

There's currently an issue with IO threads and gopher (issuing lookupKey from within the thread).
simply fix is to just not support it for now.

(cherry picked from commit c9f00bcc)
parent 5d1ac2df
...@@ -1519,8 +1519,11 @@ notify-keyspace-events "" ...@@ -1519,8 +1519,11 @@ notify-keyspace-events ""
# #
# So use the 'requirepass' option to protect your instance. # So use the 'requirepass' option to protect your instance.
# #
# To enable Gopher support uncomment the following line and set # Note that Gopher is not currently supported when 'io-threads-do-reads'
# the option from no (the default) to yes. # is enabled.
#
# To enable Gopher support, uncomment the following line and set the option
# from no (the default) to yes.
# #
# gopher-enabled no # gopher-enabled no
...@@ -1860,4 +1863,3 @@ jemalloc-bg-thread yes ...@@ -1860,4 +1863,3 @@ jemalloc-bg-thread yes
# #
# Set bgsave child process to cpu affinity 1,10,11 # Set bgsave child process to cpu affinity 1,10,11
# bgsave_cpulist 1,10-11 # bgsave_cpulist 1,10-11
...@@ -1884,8 +1884,9 @@ void processInputBuffer(client *c) { ...@@ -1884,8 +1884,9 @@ void processInputBuffer(client *c) {
if (c->reqtype == PROTO_REQ_INLINE) { if (c->reqtype == PROTO_REQ_INLINE) {
if (processInlineBuffer(c) != C_OK) break; if (processInlineBuffer(c) != C_OK) break;
/* If the Gopher mode and we got zero or one argument, process /* If the Gopher mode and we got zero or one argument, process
* the request in Gopher mode. */ * the request in Gopher mode. To avoid data race, Redis won't
if (server.gopher_enabled && * 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 == 1 && ((char*)(c->argv[0]->ptr))[0] == '/') ||
c->argc == 0)) c->argc == 0))
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment