You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2021/11/04 20:35:50 UTC

[couchdb-ioq] 10/12: Support Clouseau pids

This is an automated email from the ASF dual-hosted git repository.

chewbranca pushed a commit to branch ioq-per-shard-or-user
in repository https://gitbox.apache.org/repos/asf/couchdb-ioq.git

commit 095d5c39924b275676c497ef4e7322b6a4c9d77f
Author: Russell Branca <ch...@apache.org>
AuthorDate: Tue Sep 7 15:13:50 2021 -0700

    Support Clouseau pids
---
 src/ioq_server2.erl | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/ioq_server2.erl b/src/ioq_server2.erl
index 3cedeed..71be787 100644
--- a/src/ioq_server2.erl
+++ b/src/ioq_server2.erl
@@ -115,6 +115,14 @@ call_int({Name, Node}=Server, #ioq_request{msg=Msg}=Req) when is_atom(Name) anda
             %% TODO: add dedicated clouseau IOQ pid
             gen_server:call(ioq_server2, Req, infinity)
     end;
+call_int(Pid, #ioq_request{msg=Msg}=Req) when is_pid(Pid) ->
+    case should_bypass(Req) of
+        true ->
+            gen_server:call(Pid, Msg, infinity);
+        false ->
+            %% TODO: add dedicated clouseau IOQ pid
+            gen_server:call(ioq_server2, Req, infinity)
+    end;
 call_int(#ioq_file{ioq=undefined, fd=Fd}, #ioq_request{msg=Msg}=Req) ->
     Class = atom_to_list(Req#ioq_request.class),
     case config:get_boolean("ioq2.bypass", Class, false) of