esl / MongooseIM

MongooseIM is Erlang Solutions' robust, scalable and efficient XMPP server, aimed at large installations. Specifically designed for enterprise purposes, it is fault-tolerant and can utilise the resources of multiple clustered machines.
Other
1.64k stars 422 forks source link

Use init_ack instead of adhoc next_event #4186

Closed NelsonVides closed 5 months ago

NelsonVides commented 5 months ago

The idea behind the adhoc event was to liberate the supervisor from waiting for initalisation, so I wanted to return from init as fast as possible, but this can better be done using proc_lib:init_ack/1 instead of making up a non-existing event to handle.

Very simple refactoring simply.

mongoose-im commented 5 months ago

elasticsearch_and_cassandra_26 / elasticsearch_and_cassandra_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 368 / Failed: 0 / User-skipped: 38 / Auto-skipped: 0


small_tests_25 / small_tests / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root / small


small_tests_26 / small_tests / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root / small


small_tests_26_arm64 / small_tests / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root / small


ldap_mnesia_25 / ldap_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 2268 / Failed: 0 / User-skipped: 847 / Auto-skipped: 0


ldap_mnesia_26 / ldap_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 2268 / Failed: 0 / User-skipped: 847 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4225 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


dynamic_domains_mysql_redis_26 / mysql_redis / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4192 / Failed: 0 / User-skipped: 135 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_26 / pgsql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4225 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


internal_mnesia_26 / internal_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 2408 / Failed: 0 / User-skipped: 707 / Auto-skipped: 0


pgsql_cets_26 / pgsql_cets / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4273 / Failed: 0 / User-skipped: 110 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4614 / Failed: 0 / User-skipped: 109 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_26 / odbc_mssql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4222 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0

graphql_muc_light_SUITE:admin_cli:admin_muc_light:end_per_group ```erlang {error, {{unregistering_failed, {amount,2}, {unregistered_items, [{{<<"_admin_blocking_list_1079">>, [{escalus_event_mgr,<0.33266.0>}, {tc_name,admin_blocking_list}, {escalus_cleaner,<0.33265.0>}, {watchdog,<0.33264.0>}, {muc_light_host,<<"muclight.domain.example.com">>}, {secondary_muc_light_host,<<"muclight.domain.example.org">>}, {protocol,cli}, {schema_endpoint,admin}, {{ejabberd_cwd,mongooseim@localhost}, "/home/circleci/project/_build/mim1/rel/mongooseim"}, {preset,"odbc_mssql_mnesia"}, {mim_data_dir, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE_data"}, {tc_logfile, "https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201855/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%4013ff98e0e49c.2023-12-05_08.59.52/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.59/graphql_muc_light_suite.admin_blocking_list.71426.html"}, {tc_group_properties,[{name,admin_muc_light}]}, {tc_group_path,[[{name,admin_cli}]]}, {data_dir, "/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/graphql_muc_light_SUITE_data/"}, {priv_dir, "https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201855/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%4013ff98e0e49c.2023-12-05_08.59.52/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.59/log_private/"}, {{saved_modules,mongooseim@localhost,<<"test type">>}, #{mod_vcard => #{matches => 30, host => {prefix,<<"vjud.">>}, search => true,iqdisc => parallel,backend => rdbms}... ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201855/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%4013ff98e0e49c.2023-12-05_08.59.52/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.59/graphql_muc_light_suite.end_per_group.35459.html)

pgsql_mnesia_26 / pgsql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4614 / Failed: 0 / User-skipped: 109 / Auto-skipped: 0


mysql_redis_26 / mysql_redis / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4593 / Failed: 0 / User-skipped: 130 / Auto-skipped: 0


mssql_mnesia_26 / odbc_mssql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4609 / Failed: 2 / User-skipped: 112 / Auto-skipped: 0

graphql_muc_light_SUITE:admin_cli:admin_muc_light:admin_create_room_with_unprepped_id ```erlang {error, {#{what => invalid_response_code,expected_type => ok, response_code => {exit_status,1}}, [{graphql_helper,assert_response_code,2, [{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"}, {line,256}]}, {graphql_helper,get_ok_value,2, [{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"}, {line,239}]}, {graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1, [{file, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"}, {line,1156}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1302}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,1234}]}]}} ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201846/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40b91d132df622.2023-12-05_08.59.56/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.56/graphql_muc_light_suite.admin_create_room_with_unprepped_id.13701.html)
graphql_muc_light_SUITE:admin_cli:admin_muc_light:end_per_group ```erlang {error, {{unregistering_failed, {amount,1}, {unregistered_items, [{{<<"_admin_send_message_to_room_errors_1072">>, [{escalus_event_mgr,<0.33464.0>}, {tc_name,admin_send_message_to_room_errors}, {escalus_cleaner,<0.33463.0>}, {watchdog,<0.33462.0>}, {muc_light_host,<<"muclight.localhost">>}, {secondary_muc_light_host,<<"muclight.localhost.bis">>}, {protocol,cli}, {schema_endpoint,admin}, {{ejabberd_cwd,mongooseim@localhost}, "/home/circleci/project/_build/mim1/rel/mongooseim"}, {preset,"odbc_mssql_mnesia"}, {mim_data_dir, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE_data"}, {tc_logfile, "https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201846/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40b91d132df622.2023-12-05_08.59.56/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.56/graphql_muc_light_suite.admin_send_message_to_room_errors.60674.html"}, {tc_group_properties,[{name,admin_muc_light}]}, {tc_group_path,[[{name,admin_cli}]]}, {data_dir, "/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/graphql_muc_light_SUITE_data/"}, {priv_dir, "https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201846/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40b91d132df622.2023-12-05_08.59.56/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.56/log_private/"}, {{saved_modules,mongooseim@localhost,<<"localhost">>}, #{mod_vcard => #{matches => 30, host => {prefix,<<"vjud.">>}, search => true,iqdisc =... ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201846/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40b91d132df622.2023-12-05_08.59.56/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.56/graphql_muc_light_suite.end_per_group.62082.html)
graphql_muc_light_SUITE:domain_admin:domain_admin_muc_light:admin_create_room_with_unprepped_id ```erlang {error, {{badmatch,null}, [{graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1, [{file, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"}, {line,1155}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1302}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,1234}]}]}} ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201846/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%40b91d132df622.2023-12-05_08.59.56/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.03.56/graphql_muc_light_suite.admin_create_room_with_unprepped_id.63874.html)

mssql_mnesia_26 / odbc_mssql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4609 / Failed: 2 / User-skipped: 112 / Auto-skipped: 0

graphql_muc_light_SUITE:admin_cli:admin_muc_light:admin_create_room_with_unprepped_id ```erlang {error, {#{what => invalid_response_code,expected_type => ok, response_code => {exit_status,1}}, [{graphql_helper,assert_response_code,2, [{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"}, {line,256}]}, {graphql_helper,get_ok_value,2, [{file,"/home/circleci/project/big_tests/tests/graphql_helper.erl"}, {line,239}]}, {graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1, [{file, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"}, {line,1156}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1302}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,1234}]}]}} ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201859/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%402dab6ded5d29.2023-12-05_09.25.02/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.29.17/graphql_muc_light_suite.admin_create_room_with_unprepped_id.18309.html)
graphql_muc_light_SUITE:domain_admin:domain_admin_muc_light:admin_create_room_with_unprepped_id ```erlang {error, {{badmatch,null}, [{graphql_muc_light_SUITE,admin_create_room_with_unprepped_id,1, [{file, "/home/circleci/project/big_tests/tests/graphql_muc_light_SUITE.erl"}, {line,1155}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1793}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1302}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,1234}]}]}} ``` [Report log](https://circleci-mim-results.s3.eu-central-1.amazonaws.com/PR/4186/201859/odbc_mssql_mnesia.26.1.2-amd64/big/ct_run.test%402dab6ded5d29.2023-12-05_09.25.02/big_tests.tests.graphql_muc_light_SUITE.logs/run.2023-12-05_09.29.17/graphql_muc_light_suite.admin_create_room_with_unprepped_id.42883.html)

mssql_mnesia_26 / odbc_mssql_mnesia / 84f1c6c0aa7cbc0b7d1165df13bf2f65a4703572 Reports root/ big OK: 4611 / Failed: 0 / User-skipped: 112 / Auto-skipped: 0

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (44b57e6) 84.28% compared to head (84f1c6c) 84.27%. Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4186 +/- ## ========================================== - Coverage 84.28% 84.27% -0.01% ========================================== Files 551 551 Lines 33467 33466 -1 ========================================== - Hits 28208 28204 -4 - Misses 5259 5262 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

NelsonVides commented 5 months ago

Oh, nevermind, indeed gen_statem will already send the same ack and the supervisor will get the ack twice 🤦🏽

https://github.com/erlang/otp/blob/ad49d5d985301e8065231edff858dba4bc080bf7/lib/stdlib/src/gen_statem.erl#L1035