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

Make RDBMS query timeout configurable #3728

Merged
merged 1 commit into from
Aug 10, 2022
Merged

Conversation

NelsonVides
Copy link
Collaborator

A strict hardcoded macro is too inflexible and this is a parameter I want to iterate on the configuration easily.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #3728 (57d3ba6) into master (5a18d5a) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #3728      +/-   ##
==========================================
- Coverage   82.28%   82.24%   -0.04%     
==========================================
  Files         526      526              
  Lines       33853    33853              
==========================================
- Hits        27856    27843      -13     
- Misses       5997     6010      +13     
Impacted Files Coverage Δ
src/config/mongoose_config_spec.erl 100.00% <ø> (ø)
src/wpool/mongoose_wpool_rdbms.erl 83.33% <ø> (ø)
src/rdbms/mongoose_rdbms.erl 65.26% <100.00%> (-1.06%) ⬇️
src/ejabberd.erl 55.00% <0.00%> (-5.00%) ⬇️
src/cassandra/mongoose_cassandra.erl 77.77% <0.00%> (-3.71%) ⬇️
src/pubsub/nodetree_tree.erl 87.87% <0.00%> (-3.04%) ⬇️
src/cassandra/mongoose_cassandra_worker.erl 66.03% <0.00%> (-2.84%) ⬇️
...bal_distrib/mod_global_distrib_hosts_refresher.erl 66.66% <0.00%> (-2.23%) ⬇️
src/pubsub/node_pep.erl 77.77% <0.00%> (-1.86%) ⬇️
... and 10 more

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

@mongoose-im

This comment was marked as outdated.

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Please add a test case to config_parser_SUITE.

@@ -555,6 +555,8 @@ outgoing_pool_connection(<<"rdbms">>) ->
validate = {enum, [odbc, pgsql, mysql]}},
<<"keepalive_interval">> => #option{type = integer,
validate = positive},
<<"query_timeout">> => #option{type = integer,
validate = positive},
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
validate = positive},
validate = positive},

@@ -836,7 +836,7 @@ default_pool_conn_opts(redis) ->
database => 0,
password => ""};
default_pool_conn_opts(rdbms) ->
#{max_start_interval => 30};
#{query_timeout => 5, max_start_interval => 30};
Copy link
Member

Choose a reason for hiding this comment

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

Why 5 if the default is 5000?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Confusing seconds with milliseconds 🤦🏽

A strict hardcoded macro is too inflexible.
@mongoose-im
Copy link
Collaborator

mongoose-im commented Aug 10, 2022

small_tests_24 / small_tests / 57d3ba6
Reports root / small


small_tests_25 / small_tests / 57d3ba6
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 57d3ba6
Reports root/ big
OK: 3340 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 57d3ba6
Reports root/ big
OK: 1897 / Failed: 0 / User-skipped: 513 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 57d3ba6
Reports root/ big
OK: 3323 / Failed: 0 / User-skipped: 105 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 57d3ba6
Reports root/ big
OK: 3340 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 57d3ba6
Reports root/ big
OK: 1897 / Failed: 0 / User-skipped: 513 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 57d3ba6
Reports root/ big
OK: 3340 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 57d3ba6
Reports root/ big
OK: 3714 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 57d3ba6
Reports root/ big
OK: 2018 / Failed: 0 / User-skipped: 392 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 57d3ba6
Reports root/ big
OK: 2314 / Failed: 0 / User-skipped: 387 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 57d3ba6
Reports root/ big
OK: 3738 / Failed: 3 / User-skipped: 103 / Auto-skipped: 0

pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription
{error,{{badmatch,[{xmlel,<<"presence">>,
              [{<<"from">>,
              <<"alice_unsubscribe_after_presence_unsubscription_2201@localhost">>},
               {<<"to">>,
              <<"bob_unsubscribe_after_presence_unsubscription_2201@localhost/res1">>},
               {<<"xml:lang">>,<<"en">>},
               {<<"type">>,<<"unsubscribed">>}],
              []}]},
    [{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
          [{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
           {line,384}]},
     {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}]}]}}

Report log

pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription
{error,{{badmatch,[{xmlel,<<"presence">>,
              [{<<"from">>,
              <<"alice_unsubscribe_after_presence_unsubscription_2215@localhost/res1">>},
               {<<"to">>,
              <<"bob_unsubscribe_after_presence_unsubscription_2215@localhost/res1">>},
               {<<"type">>,<<"unavailable">>}],
              []}]},
    [{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
          [{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
           {line,384}]},
     {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}]}]}}

Report log

pubsub_SUITE:tree+node_config:send_last_published_item_test
{error,{{badmatch,false},
    [{pubsub_tools,check_response,2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,491}]},
     {pubsub_tools,receive_response,3,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,481}]},
     {pubsub_tools,receive_subscribe_response,3,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
            {line,334}]},
     {pubsub_SUITE,'-send_last_published_item_test/1-fun-0-',2,
             [{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
            {line,937}]},
     {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}]}]}}

Report log


pgsql_mnesia_25 / pgsql_mnesia / 57d3ba6
Reports root/ big
OK: 3714 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 57d3ba6
Reports root/ big
OK: 3714 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 57d3ba6
Reports root/ big
OK: 2175 / Failed: 0 / User-skipped: 380 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 57d3ba6
Reports root/ big
OK: 3709 / Failed: 0 / User-skipped: 102 / Auto-skipped: 0

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@chrzaszcz chrzaszcz merged commit bac71f0 into master Aug 10, 2022
@chrzaszcz chrzaszcz deleted the rdbms_query_timeout branch August 10, 2022 14:14
@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.

3 participants