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

Do return an Acc unexceptionally! #3743

Merged
merged 1 commit into from
Aug 29, 2022
Merged

Do return an Acc unexceptionally! #3743

merged 1 commit into from
Aug 29, 2022

Conversation

NelsonVides
Copy link
Collaborator

The specs says that process_packet must return a mongoose_acc:t(), but here, if an exception is thrown, we'd return the result of the logged error, which is the ok atom, which will crash on a later use of the acc when it was expected to be a map. See the stacktrace below, which throws a {badmap, ok} error:

mongoose_local_delivery:restore_acc_fields/2:57
mongoose_router_localdomain:route/4:25
ejabberd_router:route/5:390
ejabberd_router:route/4:140
ejabberd_c2s:process_outgoing_stanza/4:896
ejabberd_c2s:process_outgoing_stanza/2:868
p1_fsm_old:handle_msg/10:587
proc_lib:wake_up/3:250

@mongoose-im
Copy link
Collaborator

mongoose-im commented Aug 29, 2022

small_tests_24 / small_tests / c4b8aa1
Reports root / small


small_tests_25 / small_tests / c4b8aa1
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c4b8aa1
Reports root/ big
OK: 3556 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / c4b8aa1
Reports root/ big
OK: 1943 / Failed: 0 / User-skipped: 529 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / c4b8aa1
Reports root/ big
OK: 3539 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / c4b8aa1
Reports root/ big
OK: 1943 / Failed: 0 / User-skipped: 529 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / c4b8aa1
Reports root/ big
OK: 3556 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / c4b8aa1
Reports root/ big
OK: 3556 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / c4b8aa1
Reports root/ big
OK: 3930 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / c4b8aa1
Reports root/ big
OK: 2064 / Failed: 0 / User-skipped: 408 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / c4b8aa1
Reports root/ big
OK: 2404 / Failed: 0 / User-skipped: 403 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / c4b8aa1
Reports root/ big
OK: 3930 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / c4b8aa1
Reports root/ big
OK: 3925 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / c4b8aa1
Reports root/ big
OK: 2243 / Failed: 0 / User-skipped: 396 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / c4b8aa1
Reports root/ big
OK: 3930 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Merging #3743 (c4b8aa1) into master (918421a) will increase coverage by 0.04%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #3743      +/-   ##
==========================================
+ Coverage   82.70%   82.75%   +0.04%     
==========================================
  Files         529      529              
  Lines       33947    33948       +1     
==========================================
+ Hits        28075    28092      +17     
+ Misses       5872     5856      -16     
Impacted Files Coverage Δ
src/ejabberd_local.erl 77.04% <0.00%> (-0.64%) ⬇️
src/rdbms/mongoose_rdbms.erl 65.26% <0.00%> (-1.06%) ⬇️
src/mod_muc_log.erl 62.82% <0.00%> (ø)
src/ejabberd_c2s.erl 89.01% <0.00%> (+0.07%) ⬆️
src/mod_roster.erl 79.66% <0.00%> (+0.23%) ⬆️
src/mod_muc_room.erl 78.68% <0.00%> (+0.28%) ⬆️
src/ejabberd_sm.erl 84.91% <0.00%> (+0.32%) ⬆️
src/mam/mod_mam_elasticsearch_arch.erl 88.39% <0.00%> (+1.78%) ⬆️
src/cassandra/mongoose_cassandra_worker.erl 68.86% <0.00%> (+2.83%) ⬆️
src/smart_markers/mod_smart_markers_rdbms.erl 95.00% <0.00%> (+3.33%) ⬆️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@arcusfelis arcusfelis merged commit 065c08e into master Aug 29, 2022
@arcusfelis arcusfelis deleted the fix_routing_errors branch August 29, 2022 13:50
@chrzaszcz chrzaszcz added this to the 6.0.0 milestone Dec 12, 2022
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.

5 participants