-
Notifications
You must be signed in to change notification settings - Fork 428
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
Avoid calling ejabberd_sm_backend:get_sessions/3 second time when routing presences #4089
Conversation
elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 3ea695c small_tests_24 / small_tests / 3ea695c small_tests_25 / small_tests / 3ea695c small_tests_25_arm64 / small_tests / 3ea695c ldap_mnesia_24 / ldap_mnesia / 3ea695c metrics_c2s_SUITE:single:stanza_one{error,
{{xmppStanzaReceived,
{value,340},
[{times,25,
{error,
{badmatch,{value,341}},
[{metrics_helper,assert_counter,3,
[{file,
"/home/circleci/project/big_tests/tests/metrics_helper.erl"},
{line,36}]},
{mongoose_helper,do_wait_until,2,
[{file,
"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,361}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,
[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}}],
ok},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,358}]},
{escalus_story,story,4,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 3ea695c dynamic_domains_mysql_redis_25 / mysql_redis / 3ea695c ldap_mnesia_25 / ldap_mnesia / 3ea695c dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 3ea695c mam_SUITE:rdbms_async_cache_muc_all:muc_configurable_archiveid:muc_no_elements{failed,
{mam_SUITE,end_per_testcase,
{'EXIT',
{{room_archive_size,0,[{times,200,1}],ok},
[{mongoose_helper,do_wait_until,2,
[{file,
"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,358}]},
{mam_helper,wait_for_room_archive_size,3,
[{file,
"/home/circleci/project/big_tests/tests/mam_helper.erl"},
{line,789}]},
{mam_helper,clean_room_archive,1,
[{file,
"/home/circleci/project/big_tests/tests/mam_helper.erl"},
{line,733}]},
{mam_helper,destroy_room,1,
[{file,
"/home/circleci/project/big_tests/tests/mam_helper.erl"},
{line,726}]},
{mam_SUITE,end_per_testcase,2,
[{file,
"/home/circleci/project/big_tests/tests/mam_SUITE.erl"},
{line,962}]},
{test_server,do_end_per_testcase,4,
[{file,"test_server.erl"},{line,1626}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1334}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}}}} pgsql_mnesia_24 / pgsql_mnesia / 3ea695c pgsql_cets_25 / pgsql_cets / 3ea695c dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 3ea695c internal_mnesia_25 / internal_mnesia / 3ea695c pgsql_mnesia_25 / pgsql_mnesia / 3ea695c mssql_mnesia_25 / odbc_mssql_mnesia / 3ea695c mysql_redis_25 / mysql_redis / 3ea695c mongooseimctl_SUITE:accounts:ban_account{error,{{badmatch,{"Problem 'exit {{{{badmatch,{error,timeout}},\n [{mysql_conn,execute_stmt,5,\n [{file,\n \"/home/circleci/project/_build/default/lib/mysql/src/mysql_conn.erl\"},\n {line,569}]},\n {mysql_conn,handle_call,3,\n [{file,\n \"/home/circleci/project/_build/default/lib/mysql/src/mysql_conn.erl\"},\n {line,350}]},\n {gen_server,try_handle_call,4,\n [{file,\"gen_server.erl\"},{line,1149}]},\n {gen_server,handle_msg,6,\n [{file,\"gen_server.erl\"},{line,1178}]},\n {proc_lib,init_p_do_apply,3,\n [{file,\"proc_lib.erl\"},{line,240}]}]},\n {gen_server,call,\n [<0.16399.0>,\n {execute,auth_set_password_scram,\n [<<>>,\n <<\"==MULTI_SCRAM==,64,==SHA256==/lFGNLHjP/UrftSwZF8VPA==|6CrXx+7zRKPGE/+rMo/IE7bSM21h0Mi3PeS8P3seQC8=|UyecPZp/GmByncp0cgnWWON+bPIOSxrbNZt+U2ZvHgY=\">>,\n <<\"localhost\">>,<<\"mike\">>],\n no_filtermap_fun,default_timeout},\n infinity]}},\n {gen_server,call,\n ['wpool_pool-mongoose_wpool$rdbms$global$default-1',\n {sql_cmd,\n {sql_execute,auth_set_password_scram,\n [<<>>,\n <<\"==MULTI_SCRAM==,64,==SHA256==/lFGNLHjP/UrftSwZF8VPA==|6CrXx+7zRKPGE/+rMo/IE7bSM21h0Mi3PeS8P3seQC8=|UyecPZp/GmByncp0cgnWWON+bPIOSxrbNZt+U2ZvHgY=\">>,\n <<\"localhost\">>,... mongooseimctl_SUITE:sessions:status{error,
{{badmatch,
{error,
{connection_step_failed,
{{escalus_session,authenticate},
{client,<<"mike@localhost/res1">>,escalus_tcp,<0.732.2>,
undefined,
[{event_client,
[{event_manager,<0.730.2>},
{server,<<"localhost">>},
{username,<<"mike">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"mike">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"mike">>},
{server,<<"localhost">>},
{password,<<"nicniema">>},
{stream_id,<<"e4175943b89fc90e">>}]},
[{compression,false},
{starttls,true},
{stream_management,true},
{advanced_message_processing,true},
{client_state_indication,false},
{sasl_mechanisms,[<<"SCRAM-SHA-256">>,<<"PLAIN">>]},
{caps,undefined}]},
{auth_failed,<<"mike">>,
{xmlel,<<"failure">>,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}],
[{xmlel,<<"not-authorized">>,[],[]}]}}}}},
[{escalus_story,'-start_ready_clients/2-fun-0-',3,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,131}]},
{lists,foldl,3,... mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"16\n",0}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1120}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{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}]}]}} mongooseimctl_SUITE:basic:remove_expired_messages_test{error,
{{badmatch,
{error,
{connection_step_failed,
{{escalus_session,authenticate},
{client,<<"mike@localhost/res1">>,escalus_tcp,<0.1067.2>,
undefined,
[{event_client,
[{event_manager,<0.1066.2>},
{server,<<"localhost">>},
{username,<<"mike">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,<<"mike">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,<<"mike">>},
{server,<<"localhost">>},
{password,<<"nicniema">>},
{stream_id,<<"69dff9a409b54ee6">>}]},
[{compression,false},
{starttls,true},
{stream_management,true},
{advanced_message_processing,true},
{client_state_indication,false},
{sasl_mechanisms,[<<"SCRAM-SHA-256">>,<<"PLAIN">>]},
{caps,undefined}]},
{auth_failed,<<"mike">>,
{xmlel,<<"failure">>,
[{<<"xmlns">>,
<<"urn:ietf:params:xml:ns:xmpp-sasl">>}],
[{xmlel,<<"not-authorized">>,[],[]}]}}}}},
[{escalus_story,'-start_ready_clients/2-fun-0-',3,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,131}]},
{lists,foldl,... muc_SUITE:room_registration_race_condition:check_presence_route_to_offline_room{error,{{badrpc,timeout},
[{escalus_rpc,call_with_cookie_match,
[mongooseim@localhost,ejabberd_admin,register,
[<<"alicE_unnamed_2508_check_presence_route_to_offline_room_2509">>,
<<"localhost">>,<<"matygrysa">>],
3000,mongooseim],
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_rpc.erl"},
{line,34}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
{escalus_ejabberd,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_ejabberd.erl"},
{line,211}]},
{escalus_fresh,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,62}]},
{escalus_fresh,story,3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,27}]},
{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}]}]}} muc_SUITE:room_registration_race_condition:check_message_route_to_offline_room{error,{{badrpc,timeout},
[{escalus_rpc,call_with_cookie_match,
[mongooseim@localhost,ejabberd_admin,register,
[<<"alicE_unnamed_2508_check_message_route_to_offline_room_2510">>,
<<"localhost">>,<<"matygrysa">>],
3000,mongooseim],
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_rpc.erl"},
{line,34}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
{escalus_ejabberd,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_ejabberd.erl"},
{line,211}]},
{escalus_fresh,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,62}]},
{escalus_fresh,story,3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,27}]},
{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}]}]}} muc_SUITE:register:init_per_group{'EXIT',{{badrpc,timeout},
[{escalus_rpc,call_with_cookie_match,
[mongooseim@localhost,ejabberd_admin,register,
[<<"alicE">>,<<"localhost">>,<<"matygrysa">>],
3000,mongooseim],
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_rpc.erl"},
{line,34}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
{escalus_ejabberd,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_ejabberd.erl"},
{line,211}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1379}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1223}]}]}} pubsub_SUITE:tree+node_config:disable_payload_test{error,{{badrpc,timeout},
[{escalus_rpc,call_with_cookie_match,
[mongooseim@localhost,ejabberd_admin,register,
[<<"bOb_disable_payload_test_2724">>,<<"localhost">>,
<<"makrolika">>],
3000,mongooseim],
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_rpc.erl"},
{line,34}]},
{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},
{escalus_ejabberd,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_ejabberd.erl"},
{line,211}]},
{escalus_fresh,create_users,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,62}]},
{escalus_fresh,story,3,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_fresh.erl"},
{line,27}]},
{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}]}]}} pubsub_SUITE:tree+hometree_specific:can_create_node_with_existing_parent_path{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,434}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,424}]},
{pubsub_SUITE,'-can_create_node_with_existing_parent_path/1-fun-0-',
1,
[{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
{line,1783}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{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}]}]}} |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4089 +/- ##
==========================================
+ Coverage 83.37% 83.87% +0.50%
==========================================
Files 551 551
Lines 33544 33548 +4
==========================================
+ Hits 27967 28139 +172
+ Misses 5577 5409 -168
☔ View full report in Codecov by Sentry. |
…ting presences Old code calls get_session_pid for each presence We could avoid it
3ea695c
to
594eb9b
Compare
elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 594eb9b small_tests_24 / small_tests / 594eb9b small_tests_25_arm64 / small_tests / 594eb9b small_tests_25 / small_tests / 594eb9b ldap_mnesia_24 / ldap_mnesia / 594eb9b dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 594eb9b dynamic_domains_mysql_redis_25 / mysql_redis / 594eb9b ldap_mnesia_25 / ldap_mnesia / 594eb9b dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 594eb9b dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 594eb9b pgsql_cets_25 / pgsql_cets / 594eb9b internal_mnesia_25 / internal_mnesia / 594eb9b pgsql_mnesia_24 / pgsql_mnesia / 594eb9b mysql_redis_25 / mysql_redis / 594eb9b pgsql_mnesia_25 / pgsql_mnesia / 594eb9b mssql_mnesia_25 / odbc_mssql_mnesia / 594eb9b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fantastic! 🔥
Old code calls get_session_pid for each presence. Again.
We could avoid it.
Proposed changes include:
Why: