Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: function_clause when sending messages to bridges #9687

Merged
merged 2 commits into from Jan 9, 2023

Conversation

terry-xiaoyu
Copy link
Contributor

=ERROR REPORT==== 5-Jan-2023::18:02:49.025169 ===
    exception: error
    failed_call: {emqx_bridge,on_message_publish,
                     [{message,
                          <<0,5,241,129,103,66,67,230,212,88,2,0,83,26,0,0>>,
                          0,undefined,#{},#{},<<"emqx_webhook/1">>,
                          <<"my msg">>,1672912969024,[]}]}
    msg: failed_to_execute
    reason: function_clause
    stacktrace: [{emqx_bridge,get_matched_bridge_id,
                     [webhook,
                      #{body => <<"${payload}">>,connect_timeout => 15000,
                        enable => true,enable_pipelining => 100,
                        headers => #{'content-type' => <<"application/json">>},
                        max_retries => 2,method => post,pool_size => 8,
                        pool_type => random,request_timeout => 15000,
                        resource_opts =>
                            #{async_inflight_window => 100,
                              auto_restart_interval => 60000,
                              enable_queue => false,
                              health_check_interval => 15000,
                              max_queue_bytes => 104857600,
                              query_mode => async,worker_pool_size => 16},
                        ssl =>
                            #{ciphers => [],depth => 10,enable => false,
                              reuse_sessions => true,
                              secure_renegotiate => true,
                              user_lookup_fun =>
                                  {fun emqx_tls_psk:lookup/3,undefined},
                              verify => verify_none,
                              versions =>
                                  ['tlsv1.3','tlsv1.2','tlsv1.1',tlsv1]},
                        url => <<"http://localhost:8994/path1">>},
                      <<"emqx_webhook/1">>,
                      t_http_bridges_without_local_topic1,
                      [<<"webhook:t_http_bridges_with_local_topic1">>]],
                     [{file,
                          "/Users/liuxy/code/emqx50/apps/emqx_bridge/src/emqx_bridge.erl"},
                      {line,364}]},
                 {maps,fold_1,3,[{file,"maps.erl"},{line,411}]},
                 {emqx_bridge,send_to_matched_egress_bridges,2,
                     [{file,
                          "/Users/liuxy/code/emqx50/apps/emqx_bridge/src/emqx_bridge.erl"},
                      {line,141}]},
                 {emqx_bridge,on_message_publish,1,
                     [{file,
                          "/Users/liuxy/code/emqx50/apps/emqx_bridge/src/emqx_bridge.erl"},
                      {line,134}]},
                 {emqx_hooks,safe_execute,2,
                     [{file,
                          "/Users/liuxy/code/emqx50/apps/emqx/src/emqx_hooks.erl"},
                      {line,200}]},
                 {emqx_hooks,do_run_fold,3,
                     [{file,
                          "/Users/liuxy/code/emqx50/apps/emqx/src/emqx_hooks.erl"},
                      {line,180}]},
                 {emqx_broker,publish,1,
                     [{file,
                          "/Users/liuxy/code/emqx50/apps/emqx/src/emqx_broker.erl"},
                      {line,222}]},
                 {emqx_bridge_api_SUITE,t_http_bridges_local_topic,1,
                     [{file,
                          "/Users/liuxy/code/emqx50/apps/emqx_bridge/test/emqx_bridge_api_SUITE.erl"},
                      {line,336}]},
                 {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
                 {test_server,run_test_case_eval1,6,
                     [{file,"test_server.erl"},{line,1291}]},
                 {test_server,run_test_case_eval,9,
                     [{file,"test_server.erl"},{line,1223}]}]

@terry-xiaoyu terry-xiaoyu requested review from a team and thalesmg as code owners January 5, 2023 10:09
thalesmg
thalesmg previously approved these changes Jan 5, 2023
ieQu1
ieQu1 previously approved these changes Jan 5, 2023
@ieQu1
Copy link
Member

ieQu1 commented Jan 5, 2023

@terry-xiaoyu Sorry, you got merge conflicts due to my recent merge: https://github.com/emqx/emqx/pull/9682/files
Please move your changelog updates to changes/fix-9682.en.md and changes/fix-9682.zh.md files.

@terry-xiaoyu terry-xiaoyu dismissed stale reviews from ieQu1 and thalesmg via a7f612e January 6, 2023 03:43
@terry-xiaoyu terry-xiaoyu force-pushed the function_clause_when_send_msg_to_bridges branch from 93a3fdf to a7f612e Compare January 6, 2023 03:43
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 3852432161

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 22 unchanged lines in 9 files lost coverage.
  • Overall coverage increased (+0.08%) to 79.843%

Files with Coverage Reduction New Missed Lines %
apps/emqx_authz/src/emqx_authz_schema.erl 1 90.28%
apps/emqx_machine/src/emqx_machine.erl 1 79.31%
apps/emqx/src/bpapi/emqx_bpapi.erl 1 95.83%
apps/emqx/src/emqx_cm.erl 1 90.83%
apps/emqx/src/emqx_connection.erl 1 88.18%
apps/emqx/src/emqx_ws_connection.erl 1 79.28%
apps/emqx/src/emqx_flapping.erl 3 80.85%
apps/emqx/src/emqx_sys_mon.erl 5 86.46%
apps/emqx/src/emqx_reason_codes.erl 8 90.44%
Totals Coverage Status
Change from base Build 3848746808: 0.08%
Covered Lines: 22744
Relevant Lines: 28486

💛 - Coveralls

Copy link
Member

@JimMoen JimMoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@terry-xiaoyu terry-xiaoyu merged commit 336b310 into master Jan 9, 2023
@terry-xiaoyu terry-xiaoyu deleted the function_clause_when_send_msg_to_bridges branch January 9, 2023 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants