Git Product home page Git Product logo

cpg's People

Contributors

divolgin avatar okeuday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpg's Issues

cpg doesn't gracefully handle upgrading between versions

When cpg is already released and running with distributed erlang, upgrading between versions and doing a rolling release doesn't work as it should since the internal state has changed between versions.

Upgrading from v1.3.1 to master (v1.5.1) exhibits this issue.

Perhaps consider these situations when modifying internal state?

mix.exs and rebar.config out of sync

After I updated cpg to get Erlang 19 support, it complains that quickrand does not support Erlang 19. cd311e5 changed rebar.config to add Erlang 19 support. mix.exs didn't change and still depends on 1.5.1 versions of trie, reltool_util, and quickrand. Shouldn't mix.exs also have changed?

Fails to Compile on Elixir 1.1 / Erlang R18.1

With cpg v.1.5.0;

==> reltool_util (compile)
==> quickrand (compile)
==> trie (compile)
==> cpg (compile)
Compiled src/cpg_sup.erl
Compiled src/cpg_callbacks.erl
Compiled src/cpg_data.erl
Compiled src/cpg_app.erl
Compiled src/supervisor_cpg.erl
Compiled src/supervisor_cpg_sup.erl
Compiling src/supervisor_cpg_spawn.erl failed:
src/supervisor_cpg_spawn.erl:349: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
ERROR: compile failed while processing /home/havvy/workspace/gald_umbrella/deps/cpg: rebar_abort
*\* (Mix) Could not compile dependency :cpg, "/home/havvy/.mix/rebar" command failed. You can recompile this dependency with "mix deps.compile cpg", update it with "mix deps.update cpg" or clean it with "mix deps.clean cpg"

cpg registered processes crash VM when killed.

I am looking for process groups lib and was experimenting with cpg. When I register processes via cpg and kill any but he last process in the group the VM crashes. This is with erlang VM 18.1.

I created a little github project to demo the problem:

https://github.com/ashneyderman/cpg_issue.git

The README.md - https://github.com/ashneyderman/cpg_issue/blob/master/README.md - has the shell output and a bit more details on what works and what does not.

Is this a known cpg issue?
Any suggestions on what to do to avoid VM crash?

Callbacks for join/leave

It would be handy in some circumstances to have a registered callback for all voluntary join/leave events. That is, if a process identified by pid P joins group G, I would like some statically configured handle_join(Pid :: pid(), Group :: string()) -> ok to be called as handle_join(P, G), the idea here being you could 'bootstrap' newly joined processes to their group. Similarly a handle_leave/2 for leaves.

I say voluntary above, implying that processes which crash after joining a group will not result in such a call. Perhaps an additional callback to handle this case would be desirable?

Does not compile with Elixir 1.7 and OTP 21

$ elixir -v
Erlang/OTP 21 [erts-10.0.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Elixir 1.7.1 (compiled with Erlang/OTP 21)

cpg is at version 1.7.3.

Running env DEBUG=1 mix deps.compile cpg yields the following result:

===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Compiling cpg
===> run_hooks("/Users/daniel/Documents/Work/foobar/project/deps/cpg", pre_hooks, compile) -> no hooks defined

===> run_hooks("/Users/daniel/Documents/Work/foobar/project/deps/cpg", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info,
              {d,'ERLANG_OTP_VERSION_21'},
              warnings_as_errors,strict_validation,warn_bif_clash,
              warn_deprecated_function,warn_export_all,warn_export_vars,
              warn_exported_vars,warn_obsolete_guard,warn_shadow_vars,
              warn_unused_import,warn_unused_function,warn_unused_record,
              warn_unused_vars]
===> files to compile ["/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/cpg_data.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/cpg_node_monitor.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/cpg.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/supervisor_cpg_sup.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/cpg_callbacks.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/cpg_app.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/cpg_sup.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/supervisor_cpg_spawn.erl",
                       "/Users/daniel/Documents/Work/foobar/project/deps/cpg/src/supervisor_cpg.erl"]
===>      Compiled cpg_data.erl
===>      Compiled cpg_node_monitor.erl
===>      Compiled cpg.erl
===>      Compiled supervisor_cpg_sup.erl
===> Compiling src/cpg_callbacks.erl failed
src/cpg_callbacks.erl:186: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace

===> Compilation failed: {error,[],
                                [["src/cpg_callbacks.erl:186: erlang:get_stacktrace/0: deprecated; use the new try/catch syntax for retrieving the stack backtrace\n"]]}
** (Mix) Could not compile dependency :cpg, "/Users/daniel/.asdf/installs/elixir/1.7.1-otp-21/.mix/rebar3 bare compile --paths "/Users/daniel/Documents/Work/foobar/project/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile cpg", update it with "mix deps.update cpg" or clean it with "mix deps.clean cpg"

I think this is happening because ERLANG_OTP_VERSION_21_FEATURES isn't being defined correctly, which is weird because it looks like ERLANG_OTP_VERSION_21 is being set correctly.

Cannot get it working?

Using elixir I added :cpg to applications in the mix. Tried both with just calling :reltool_util.application_start(:cpg), and having it in applications and calling.

:application.which_applications()
[...
 {:cpg, 'CloudI Process Groups', '1.5.1'}
]

I then try

iex(dev@1.1.1.1)4> :cpg.which_groups                
** (exit) exited in: :gen_server.call(:cpg_default_scope, :which_groups)
    ** (EXIT) no process
    (stdlib) gen_server.erl:204: :gen_server.call/2

Subscribing to callbacks twice?

Should subscribing to the same group callbacks with the same function twice be not allowed?

cpg:add_join_callback("group", fun test_cpg_app:join_callback/2).
cpg:add_join_callback("group", fun test_cpg_app:join_callback/2).

cpg:join("group", self()).
% join_callback procs twice

Its easy to subscribe twice to the same callback if a subscribing process gets restarted by a supervisor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.