derekkraan / highlander Goto Github PK
View Code? Open in Web Editor NEWThere can only be one (process in your cluster)!
License: MIT License
There can only be one (process in your cluster)!
License: MIT License
GenServer #PID<0.3098.0> terminating
** (stop) exited in: GenServer.stop(#PID<0.3099.0>, {:function_clause, [{Highlander, :handle_info, [{:EXIT, #PID<0.3099.0>, :shutdown}, %{pid: #PID<0.3099.0>, child_spec: %{id: Acme.Worker, start: {Acme.Worker, :start_link, [[]]}}}], [file: ~c"lib/highlander.ex", line: 90]}, {:gen_server, :try_handle_info, 3, [file: ~c"gen_server.erl", line: 1095]}, {:gen_server, :handle_msg, 6, [file: ~c"gen_server.erl", line: 1183]}, {:proc_lib, :init_p_do_apply, 3, [file: ~c"proc_lib.erl", line: 241]}]}, :infinity)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(elixir 1.15.7) lib/gen_server.ex:1031: GenServer.stop/3
(highlander 0.2.1) lib/highlander.ex:101: Highlander.terminate/2
(stdlib 5.2) gen_server.erl:1143: :gen_server.try_terminate/3
(stdlib 5.2) gen_server.erl:1339: :gen_server.terminate/10
(stdlib 5.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.3099.0>, :shutdown}
State: %{pid: #PID<0.3099.0>, child_spec: %{id: Acme.Worker, start: {Acme.Worker, :start_link, [[]]}}}
I'm running tests with
ELIXIR_ERL_OPTIONS='-kernel prevent_overlapping_partitions false' mix test
fails with
test/netsplit_test.exs:56
Unexpectedly received message {:hello_from, #PID<22941.277.0>} (which matched {:hello_from, _})
code: refute_receive({:hello_from, _})
stacktrace:
test/netsplit_test.exs:73: (test)
To me it looks like the test case is wrong.
At the risk of adding a slight complexity to a great simple library.
I have two use cases where the default behavior is not optimal.
When adding a new machine to the cluster, on startup before other nodes are discovered grabbing the global name will eventually cause a name conflict and possibly unnecessarily kill the existing owner that has been up for some time.
In a cluster where there are mix of permanent instance and spot instances, I would prefer permanent instances take priority over the spots.
My initial approach is to call a function in the child module (if defined), during the registration which can add a pause. If this seems like a sane approach I will submit a pull request when done.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.