EMQX: v5.0.8
我有两个Exhook Server
分别注册了五个钩子
其中第一个Exhook Server工作正常,返回ok, 没有stop,第二个ExHook Server访问超时。
在这种情况下,对于客户端连接,订阅,发布消息取决于哪个Exhook的结果
第二个ExHook出现异常时,EMQX的错误日志:
[error] clientid: xxx, function: on_message_publish, line: 412, mfa: emqx_exhook_server:do_call/5, module: emqx_exhook_v_2_hook_provider_client, msg: exhook_call_error, options: #{channel => <<"emqx-bridge-staging">>,failed_action => ignore,key_dispatch => <<"rule_acl_test_czw">>,timeout => 15000}, peername: xx.xx.xxx.xxx:17459, reason: {deadline_exceeded,<<"Waiting for response timeout">>}, req: #{message => #{from => <<"rule_acl_test_czw">>,headers => #{},id => <<"0006053E3104353C53AAF711795E042F">>,node => <<"emqx@10.6.0.11">>,payload => <<"{\"username\":\"xxx\",\"topic\":\"/xxx/xxx/xxx/xxx\",\"timestamp\":1694614528734,\"result\":\"allow\",\"peerhost\":\"xxx.xx.xxx.xxx\",\"node\":\"emqx@10.6.0.11\",\"metadata\":{\"rule_id\":\"rule_acl_test_czw\"},\"event\":\"client.check_authz_complete\",\"clientid\":\"xxx\",\"authz_source\":\"exhook\",\"action\":\"publish\"}">>,qos => 1,timestamp => 1694614528734,topic => <<"/xxx/xxx">>},meta => #{cluster_name => "emqxcl",node => <<"emqx@10.6.0.11">>,sysdescr => "EMQX",version => "5.0.8"}}
[warning] action: discard, line: 480, mfa: emqx_cm:request_stepdown/3, msg: session_stepdown_request_timeout, pid: <0.25979.3399>, stale_channel: [{status,waiting},{message_queue_len,3},{current_stacktrace,[{grpc_client,call,3,[{file,"grpc_client.erl"},{line,730}]},{grpc_client,recv,2,[{file,"grpc_client.erl"},{line,237}]},{grpc_client,unary,4,[{file,"grpc_client.erl"},{line,168}]},{emqx_exhook_server,do_call,5,[{file,"emqx_exhook_server.erl"},{line,387}]},{emqx_exhook,cast,3,[{file,"emqx_exhook.erl"},{line,42}]},{emqx_hooks,safe_execute,2,[{file,"emqx_hooks.erl"},{line,200}]},{emqx_hooks,do_run,2,[{file,"emqx_hooks.erl"},{line,167}]},{emqx_channel,ensure_connected,1,[{file,"emqx_channel.erl"},{line,2137}]},{emqx_channel,process_connect,2,[{file,"emqx_channel.erl"},{line,616}]},{emqx_connection,with_channel,3,[{file,"emqx_connection.erl"},{line,790}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,466}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,472}]},{emqx_connection,handle_recv,3,[{file,"emqx_connection.erl"},{line,428}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}]
[warning] action: {takeover,'begin'}, clientid: xxx, line: 480, mfa: emqx_cm:request_stepdown/3, msg: session_stepdown_request_timeout, peername: 192.168.0.189:51600, pid: <0.25469.3399>, stale_channel: [{status,waiting},{message_queue_len,2},{current_stacktrace,[{grpc_client,call,3,[{file,"grpc_client.erl"},{line,730}]},{grpc_client,recv,2,[{file,"grpc_client.erl"},{line,237}]},{grpc_client,unary,4,[{file,"grpc_client.erl"},{line,168}]},{emqx_exhook_server,do_call,5,[{file,"emqx_exhook_server.erl"},{line,387}]},{emqx_exhook,cast,3,[{file,"emqx_exhook.erl"},{line,42}]},{emqx_hooks,safe_execute,2,[{file,"emqx_hooks.erl"},{line,200}]},{emqx_hooks,do_run,2,[{file,"emqx_hooks.erl"},{line,167}]},{emqx_channel,ensure_disconnected,2,[{file,"emqx_channel.erl"},{line,2137}]},{emqx_channel,handle_info,2,[{file,"emqx_channel.erl"},{line,1261}]},{emqx_connection,with_channel,3,[{file,"emqx_connection.erl"},{line,790}]},{emqx_connection,process_msg,2,[{file,"emqx_connection.erl"},{line,466}]},{emqx_connection,handle_recv,3,[{file,"emqx_connection.erl"},{line,428}]},{proc_lib,wake_up,3,[{file,"proc_lib.erl"},{line,236}]}]}]