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.66k stars 426 forks source link

Duplicate modules: p1_fsm, p1_prof, treap #291

Closed erszcz closed 9 years ago

erszcz commented 9 years ago

We use p1_cache_tab which in turn fetches p1_utils. The latter is a package introduced in the new (i.e. post 2.x line) ejabberd and contains a number of p1_*.erl modules. However, we still have equivalents in apps/ejabberd/src/, since back in the day when we forked the modules were distributed with ejabberd.

This leads to duplicate beam files in the release, but I haven't experienced problems because of this. However, it makes generating a Dialyzer PLT impossible due to the error:

dialyzer: Analysis failed with error:
Duplicate modules: [["/Users/erszcz/work/esl/mongooseim/apps/ejabberd/ebin/p1_fsm.beam",
                     "/Users/erszcz/work/esl/mongooseim/deps/p1_utils/ebin/p1_fsm.beam"],
                    ["/Users/erszcz/work/esl/mongooseim/apps/ejabberd/ebin/p1_prof.beam",
                     "/Users/erszcz/work/esl/mongooseim/deps/p1_utils/ebin/p1_prof.beam"],
                    ["/Users/erszcz/work/esl/mongooseim/apps/ejabberd/ebin/treap.beam",
                     "/Users/erszcz/work/esl/mongooseim/deps/p1_utils/ebin/treap.beam"]]

Is anyone aware of any reason not to drop the modules from apps/ejabberd/src/ and rely on p1_utils?

michalwski commented 9 years ago

I wasn't aware of any reason so I tried p1_fsm from p1_utils and everything works correctly (at least our tests say so) but session management... To narrow down the problem I renamed p1_fsm from apps/ejabberd/src to p1_fsm_old and used it only for ejabberd_c2s with that trick all tests from sm_SUITE pass.

michalwski commented 9 years ago

The main difference between p1_fsm from p1_utils and p1_fms_old is that the first one resends queued messages in terminate function while the second one doesn't.

michalwski commented 9 years ago

This was solved by #322