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

Hosttypyfy wpool #3170

Merged
merged 5 commits into from
Jul 13, 2021
Merged

Hosttypyfy wpool #3170

merged 5 commits into from
Jul 13, 2021

Conversation

arcusfelis
Copy link
Contributor

@arcusfelis arcusfelis commented Jul 2, 2021

Proposed changes include:

  • HostTypes in wpool
  • Better specs in wpool

@codecov
Copy link

codecov bot commented Jul 2, 2021

Codecov Report

Merging #3170 (318756d) into master (2a6381f) will decrease coverage by 20.58%.
The diff coverage is 78.78%.

❗ Current head 318756d differs from pull request most recent head 91f57d2. Consider uploading reports for the commit 91f57d2 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master    #3170       +/-   ##
===========================================
- Coverage   79.92%   59.33%   -20.59%     
===========================================
  Files         396      396               
  Lines       32335    32347       +12     
===========================================
- Hits        25843    19194     -6649     
- Misses       6492    13153     +6661     
Impacted Files Coverage Δ
src/wpool/mongoose_wpool_cassandra.erl 0.00% <0.00%> (-95.66%) ⬇️
src/wpool/mongoose_wpool_elastic.erl 0.00% <0.00%> (-90.91%) ⬇️
src/wpool/mongoose_wpool_mgr.erl 76.05% <ø> (ø)
src/wpool/mongoose_wpool_rdbms.erl 0.00% <0.00%> (-79.17%) ⬇️
src/wpool/mongoose_wpool_sup.erl 100.00% <ø> (ø)
src/wpool/mongoose_wpool.erl 75.72% <78.94%> (-9.28%) ⬇️
src/event_pusher/mod_event_pusher_push.erl 94.73% <100.00%> (+0.17%) ⬆️
src/event_pusher/mod_event_pusher_sns.erl 89.47% <100.00%> (+0.43%) ⬆️
src/mod_push_service_mongoosepush.erl 83.60% <100.00%> (+0.55%) ⬆️
src/wpool/mongoose_wpool_generic.erl 100.00% <100.00%> (ø)
... and 156 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a6381f...91f57d2. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 6, 2021

small_tests_21_3 / small_tests / 22c3d6e
Reports root / small


dynamic_domains / pgsql_mnesia / 22c3d6e
Reports root/ big
OK: 1565 / Failed: 0 / User-skipped: 121 / Auto-skipped: 0


small_tests_22 / small_tests / 22c3d6e
Reports root / small


small_tests_23 / small_tests / 22c3d6e
Reports root / small


ldap_mnesia_21 / ldap_mnesia / 22c3d6e
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


internal_mnesia / internal_mnesia / 22c3d6e
Reports root/ big
OK: 1586 / Failed: 1 / User-skipped: 286 / Auto-skipped: 0

dynamic_domains_SUITE:with_mod_dynamic_domains_test:packet_handling_for_subdomain
{error,
  {{badrpc,
     {'EXIT',
       {timeout,
         [{meck_proc,wait,6,
            [{file,
               "/home/circleci/app/_build/default/lib/meck/src/meck_proc.erl"},
             {line,171}]},
          {meck,wait,5,[]}]}}},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},
       meck,wait,
       [3,mod_dynamic_domains_test,process_packet,5,500]],
      [{file,"/home/circleci/app/big_tests/tests/distributed_helper.erl"},
       {line,117}]},
    {dynamic_domains_SUITE,'-packet_handling_for_subdomain/1-fun-3-',1,
      [{file,
         "/home/circleci/app/big_tests/tests/dynamic_domains_SUITE.erl"},
       {line,113}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/app/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1754}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1263}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1195}]}]}}

Report log


ldap_mnesia_23 / ldap_mnesia / 22c3d6e
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


ldap_mnesia_22 / ldap_mnesia / 22c3d6e
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


elasticsearch_and_cassandra / elasticsearch_and_cassandra_mnesia / 22c3d6e
Reports root/ big
OK: 1890 / Failed: 0 / User-skipped: 282 / Auto-skipped: 0


pgsql_mnesia / pgsql_mnesia / 22c3d6e
Reports root/ big
OK: 3083 / Failed: 0 / User-skipped: 184 / Auto-skipped: 1


mysql_redis / mysql_redis / 22c3d6e
Reports root/ big
OK: 3067 / Failed: 0 / User-skipped: 201 / Auto-skipped: 0


mssql_mnesia / odbc_mssql_mnesia / 22c3d6e
Reports root/ big
OK: 3082 / Failed: 0 / User-skipped: 184 / Auto-skipped: 2


riak_mnesia / riak_mnesia / 22c3d6e
Reports root/ big
OK: 1737 / Failed: 0 / User-skipped: 285 / Auto-skipped: 0


internal_mnesia / internal_mnesia / 22c3d6e
Reports root/ big
OK: 1587 / Failed: 0 / User-skipped: 286 / Auto-skipped: 0


pgsql_mnesia / pgsql_mnesia / 22c3d6e
Reports root/ big
OK: 3084 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


mssql_mnesia / odbc_mssql_mnesia / 22c3d6e
Reports root/ big
OK: 3084 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0

rebar.config Outdated
@@ -71,7 +73,7 @@
{cpool, "0.1.0"},
{observer_cli, "1.5.4"},
{nkpacket, {git, "https://github.com/michalwski/nkpacket.git", {ref, "f7c5349"}}},
{nksip, {git, "https://github.com/NetComposer/nksip.git", {ref, "1a29ef3"}}},
{nksip, {git, "https://github.com/arcusfelis/nksip.git", {branch, "mu-fix-types-1a29ef3"}}},
Copy link
Collaborator

Choose a reason for hiding this comment

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

please submit PR with these fixes to the original repo.

Copy link
Contributor Author

@arcusfelis arcusfelis Jul 12, 2021

Choose a reason for hiding this comment

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

We use nksip from 5 years ago:

commit 1a29ef3e112ee0a8d8ac53bd6963ccc8f7879343
Author: Carlos Gonzalez <[email protected]>
Date:   Fri Nov 4 20:13:40 2016 +0100

    Fixed license

We would be a bit late with this PR


%% Used to supress opaque check of dialyzer
-spec identity(any()) -> any().
identity(X) -> X.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't really understand why we need it. please, illustrate it on some example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

without it you will get error that opaque type is used in mim code, while tuple is expected.

@@ -284,6 +271,28 @@ translate_to_sip(<<"session-terminate">>, Jingle, Acc) ->
{error, item_not_found}
end.

%% There is some mess with types hapenning in nksip_uac:invite/3
Copy link
Collaborator

Choose a reason for hiding this comment

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

didn't you fix it in your fork?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nooo, there are still weird types in nksip.
I've fixed one or two errors only.

@@ -138,6 +138,8 @@ rsm_ns_binary() -> <<"http://jabber.org/protocol/rsm">>.
-type archive_behaviour() :: mod_mam:archive_behaviour().
-type archive_behaviour_bin() :: binary(). % `<<"roster">> | <<"always">> | <<"never">>'.

%% calendar:rfc3339_string() type is not exported
-type rfc3339_string() :: [byte(), ...].
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we put this type in some generic module (e.g. mongooseim)?

-type smid() :: base64:ascii_binary().

%% base64:ascii_binary() type is not exported
-type ascii_binary() :: binary().
Copy link
Collaborator

Choose a reason for hiding this comment

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

the same question, should we put this type in some generic module (e.g. mongooseim)?

@@ -7,6 +7,7 @@
-module(mongoose_redis).
-author("[email protected]").
-include("mongoose.hrl").
-include_lib("eredis/include/eredis.hrl").
Copy link
Collaborator

Choose a reason for hiding this comment

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

is return_value() defined in eredis.hrl, it seems to be a wrong approach

Copy link
Contributor Author

Choose a reason for hiding this comment

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

say it to eredis authors

rebar.config Outdated
@@ -178,7 +180,24 @@
{override, jwerl, [{plugins, [rebar3_elixir, rebar3_hex]}]}
]}.

{dialyzer, [{plt_extra_apps, [jid, cowboy, lasse, p1_utils, ranch, gen_fsm_compat, epgsql]}]}.
{dialyzer, [
Copy link
Collaborator

Choose a reason for hiding this comment

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

great job, but probably it's better to have it in a separate PR. it's just a wish for the future, no need to make a split of this one.

src/jlib.erl Outdated
@@ -78,12 +78,16 @@
-type rsm_in() :: #rsm_in{}.
-type rsm_out() :: #rsm_out{}.

%% calendar:rfc3339_string() type is not exported
-type rfc3339_string() :: [byte(), ...].
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we put this type in some generic module (e.g. mongooseim)?

Copy link
Collaborator

@DenysGonchar DenysGonchar left a comment

Choose a reason for hiding this comment

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

PR looks very good, I'd like to recheck just a few minor things before merging it.

@DenysGonchar
Copy link
Collaborator

Also that would be nice to run some integration tests with host-type specific pools.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jul 12, 2021

small_tests_21_3 / small_tests / 91f57d2
Reports root / small


small_tests_22 / small_tests / 91f57d2
Reports root / small


dynamic_domains / pgsql_mnesia / 91f57d2
Reports root/ big
OK: 1585 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


small_tests_23 / small_tests / 91f57d2
Reports root / small


ldap_mnesia_21 / ldap_mnesia / 91f57d2
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


ldap_mnesia_22 / ldap_mnesia / 91f57d2
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


internal_mnesia / internal_mnesia / 91f57d2
Reports root/ big
OK: 1587 / Failed: 0 / User-skipped: 286 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 91f57d2
Reports root/ big
OK: 1514 / Failed: 0 / User-skipped: 359 / Auto-skipped: 0


elasticsearch_and_cassandra / elasticsearch_and_cassandra_mnesia / 91f57d2
Reports root/ big
OK: 1890 / Failed: 0 / User-skipped: 282 / Auto-skipped: 0


mssql_mnesia / odbc_mssql_mnesia / 91f57d2
Reports root/ big
OK: 3083 / Failed: 0 / User-skipped: 184 / Auto-skipped: 1


pgsql_mnesia / pgsql_mnesia / 91f57d2
Reports root/ big
OK: 3084 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0


mysql_redis / mysql_redis / 91f57d2
Reports root/ big
OK: 3075 / Failed: 1 / User-skipped: 201 / Auto-skipped: 0

connect_SUITE:just_tls:feature_order:auth_compression_bind_session
{error,
  {{badmatch,
     {error,
       {connection_step_failed,
         {{escalus_session,maybe_use_compression},
          {client,
            <<"secure_joe_auth_compression_bind_session_48.697942@localhost">>,
            escalus_tcp,<0.13384.0>,undefined,
            [{username,
               <<"secure_joe_auth_compression_bind_session_48.697942">>},
             {server,<<"localhost">>},
             {password,<<"break_me">>},
             {compression,<<"zlib">>},
             {starttls,required},
             {host,<<"localhost">>},
             {stream_id,<<"60841b22773b84ab">>}]},
          [{compression,[<<"zlib">>]},
           {starttls,false},
           {stream_management,true},
           {advanced_message_processing,true},
           {client_state_indication,false},
           {sasl_mechanisms,[<<"SCRAM-SHA-256">>,<<"PLAIN">>]},
           {caps,undefined}]},
         {timeout,stream_start}}}},
   [{connect_SUITE,auth_compression_bind_session,1,
      [{file,"/home/circleci/app/big_tests/tests/connect_SUITE.erl"},
       {line,517}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1754}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1263}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1195}]}]}}

Report log


riak_mnesia / riak_mnesia / 91f57d2
Reports root/ big
OK: 1737 / Failed: 0 / User-skipped: 285 / Auto-skipped: 0


mssql_mnesia / odbc_mssql_mnesia / 91f57d2
Reports root/ big
OK: 3084 / Failed: 0 / User-skipped: 184 / Auto-skipped: 0

@mongoose-im

This comment has been minimized.

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.

Nice, I like the new types, good work!

big_tests/test.config Outdated Show resolved Hide resolved
@@ -74,26 +74,31 @@
%%--------------------------------------------------------------------
%% gen_mod callbacks
%%--------------------------------------------------------------------
-spec start(Host :: jid:server(), Opts :: list()) -> any().
-spec start(HostType :: mongooseim:host_type(), Opts :: gen_mod:module_opts()) -> any().
Copy link
Member

Choose a reason for hiding this comment

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

Minor, I think that variable names should agree between the spec and the implementation. We could either change to HostType or leave Host in both places.

@chrzaszcz chrzaszcz merged commit f86f1d1 into master Jul 13, 2021
@chrzaszcz chrzaszcz deleted the mu-hosttype-wpool branch July 13, 2021 15:36
@Premwoik Premwoik added this to the 5.0.0 milestone Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants