cloudi / cloudi Goto Github PK
View Code? Open in Web Editor NEWA Cloud at the lowest level!
Home Page: https://cloudi.org/
License: MIT License
A Cloud at the lowest level!
Home Page: https://cloudi.org/
License: MIT License
A service configuration option to specify when an Erlang application name is different from the CloudI service module name. This will also affect starting an internal CloudI service which is a release.
Need to determine if the combo of O_NONBLOCK being set on the new accepted socket causes problems when it is later moved from {active, false} to {active, once}. It is unclear whether this is a bug in Erlang or in CloudI.
Changes to the internal service init function to avoid dead-lock and provide the full CloudI API cause the database drivers to have a premature death due to their implicit process link. This problem impacts at least all usage of the PostgreSQL and MySQL drivers, so it is a serious problem.
Might be able to generalize this to be a rate check on a timer. See #57 for the generic part.
put all the functions in the single module, add edoc info, move the current cloudi_service_api module to a different name, update the config
Hi,
When building CloudI I've ran into a couple of issues:
escript: exception error: no function clause matching
orddict:fetch(cpg_app,
[....])
{error, eloop}
Any ideas?
My environment:
The versions of Erlang I've tried this with:
Let me know if there are any pertinent version numbers you need to know.
Full traces on demand.
Thanks in advance,
Aaron
This requires the user of the cloudi module to handle an incoming message, that then calls a cloudi module function to update the context data with the lazy lookup data (cpg_data), so the documentation needs to clearly show this as a requirement. An error, when the lookup data is missing can help to show the requirement.
used for compilation of CloudI as a rebar dependency
move cloudi.conf to cloudi.conf.old1
Also, the change should avoid a dead-lock on the application process when services_stop is being used within an application stop callback.
Hi there, sorry this is not a bug report, but I could not find the proper channel for passing this feedback. First, let me state I find Cloudi a very interesting project. Now, my problem. You have chosen to punish my eyes by designing the website text to be white on black. This makes a terribly painful read in my opinion. Last time I downloaded a copy of the page and adapted the CSS in order to be able to read it. That information is now outdated and I don't feel like having to do the same every time I want to read the latest info on the project.
May I suggest you use standard black on white text?
Thank you,
Rudi Angela
Supposedly, OpenShift claims localhost is "deprecated" with their virtualization because it is shared with all users on the physical machine. This also can help users depend on the OpenShift framework more-so. To avoid this problem, add a new external service protocol configuration option (current options are tcp and udp, where udp is experimental) called "pipe" so that sockets on localhost are not used. This was planned previously as a test case, but this issue provides justification for providing it as a feature.
Need flags to disable the CloudI API support for specific programming languages, to limit the necessary dependencies. Also, (possibly) provide a disable flag that disables all external services, which prevents the creation of the Erlang port for spawning external services.
Hi,
When I build cloudi follow the instruction, I occur error when I make it.
Error:
/bin/sh ../../../libtool --tag=CXX --mode=link g++ -I/usr/local/include -L../../../api/c/ -L/usr/local/lib -L/usr/local/lib -o hexpi hexpi-assert.o hexpi-main.o hexpi-timer.o hexpi-piqpr8_gmp.o hexpi-piqpr8_gmp_verify.o -lcloudi -lboost_thread-mt -lgmp
libtool: link: g++ -I/usr/local/include -o hexpi hexpi-assert.o hexpi-main.o hexpi-timer.o hexpi-piqpr8_gmp.o hexpi-piqpr8_gmp_verify.o -Wl,-bind_at_load -L/Users/zhangbo/work/cloudi-1.0.0/src/api/c -L/usr/local/lib /Users/zhangbo/work/cloudi-1.0.0/src/api/c/.libs/libcloudi.a -L/usr/local/lib/erlang/lib/erl_interface-3.7.7/lib/ -lei -lboost_thread-mt /usr/local/lib/libgmp.dylib
Undefined symbols for architecture x86_64:
"boost::assertion_failed_msg(char const_, char const_, char const_, char const_, long)", referenced from:
boost::mutex::try_lock() in hexpi-main.o
"boost::system::system_category()", referenced from:
static_initialization_and_destruction_0(int, int)in hexpi-main.o
boost::thread_exception::thread_exception(int, char const)in hexpi-main.o
boost::condition_error::condition_error(int, char const)in hexpi-main.o
"boost::system::generic_category()", referenced from:
__static_initialization_and_destruction_0(int, int)in hexpi-main.o
ld: symbol(s) not found for architecture x86_64
configure is OK
My OS:
Mac mountain lion 10.8.1 x86_64
Software:
boost: brew install boost version 1.5.0
/usr/local/lib/libboost_thread-mt.dylib: Mach-O 64-bit dynamically linked shared library x86_64
ruby: brew install ruby version 1.9.3
jdk:1.6.0_35
erlang: R15B01 x86_64
i686-apple-darwin11-llvm-g++-4.2
Also, update ranch to 0.9.0. Look at barrel integration now.
Add guards to make sure Timeout =< (4294967295 - ?TIMEOUT_DELTA)
After the scope script has processed all source files, and source files are updated and pulled, they do not get processed... instead errors are produced when processing the app file. This is only a problem when a git pull occurs within a built repo... so this doesn't relate to a clean build. This may specifically relate to changing the version of an Erlang application (since this occurred with the jsx Erlang application update, and the actual source code changes were limited).
Don't use master/branch setting in rebar.config so that rebar update-deps can work.
Some cloudi_service types would be simpler to reference from the cloudi module. These types include:
cloudi_service:request_type()
cloudi_service:dispatcher()
Check to see if there is other overlap to add, to shorten the type prefix. See if there is missing types.
both dynamic service additions and usage of reltool.config, for internal service usage
Currently, rebar isn't providing success/fail from an erlzmq2 build... a proper zeromq install is assumed to provide a working erlzmq2 build. Need to change the configure script to fail if erlzmq2 compilation fails. This may be easiest with autoconf/automake inserting erlzmq2 to be built with the other Erlang dependencies (currently it is built separately).
Document homebrew instructions required for CloudI installation to avoid confusion.
Change the cowboy internal service to utilize the immediate destination refresh method, to put a burden on the cpg ets integration, and determine the improvement when doing a loadtest with and without the cpg ets change.
Gets more complex when stopping a release or an application.
I have an up-to-date brew installation and get the follow on make:
libtool: link: sed -e 's,^,_,' < .libs/libcloudi_socket_drv.exp > .libs/libcloudi_socket_drv-symbols.expsym
libtool: link: g++ -o .libs/libcloudi_socket_drv.so -bundle .libs/libcloudi_socket_drv_la-cloudi_socket_drv.o .libs/libcloudi_socket_drv_la-assert.o -O2 -Wl,-exported_symbols_list,.libs/libcloudi_socket_drv-symbols.expsym
Undefined symbols for architecture x86_64:
"_enif_get_int", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_get_string", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_make_atom", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_make_badarg", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_make_tuple", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_mutex_create", referenced from:
_on_load in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_mutex_destroy", referenced from:
_on_unload in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_mutex_lock", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_enif_mutex_unlock", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
"_erl_errno_id", referenced from:
_libcloudi_socket_drv_local_listen in libcloudi_socket_drv_la-cloudi_socket_drv.o
_libcloudi_socket_drv_local_accept in libcloudi_socket_drv_la-cloudi_socket_drv.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[5]: *** [libcloudi_socket_drv.la] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
bug reported by Alex Demidenko:
Hi, Michael!
I found strange behavoiur (tested at cloudi 1.2.2)
If I make a send request from cloudi_service_init(), the answer will not be returned.
I'll try to show by example:
-module(cloudi_ping_pong).
-include_lib("cloudi_core/include/cloudi_logger.hrl").
-export([cloudi_service_init/3, cloudi_service_handle_request/11, cloudi_service_handle_info/3, cloudi_service_terminate/2]).
%%%%
cloudi_service_init([ponger], _Prefix, Dispatcher) ->
?LOG_INFO("init ponger", []),
ok = cloudi_service:subscribe(Dispatcher, "ponger"),
{ok, ponger};
cloudi_service_init([pinger], Prefix, Dispatcher) ->
?LOG_INFO("init pinger", []),
Result = cloudi_service:send_sync(Dispatcher, Prefix++"ponger", ping), %Unsuccessfull sync request
?LOG_INFO("ping responce: ~p", [Result]), % This report never work
{ok, pinger}.
%%%%
cloudi_service_handle_request(_Type, _Name, _Pattern, _RequestInfo, ping, _Timeout, _Priority, _TransId, _Pid, ponger = State, _Dispatcher) ->
?LOG_INFO("pong request", []),
{reply, pong, State}.
%%%%
cloudi_service_handle_info(_Request, State, _Dispatcher) ->
{noreply, State}.
%%%%
cloudi_service_terminate(_Reason, _State) ->
ok.
For example I used follow sections inside cloudi.conf
{internal,
"/test/",
cloudi_ping_pong,
[ponger], % First service entity
immediate_local,
10000, 10000, 10000, undefined, undefined, 1, 1, 300,
[]},
{internal,
"/test/",
cloudi_ping_pong,
[pinger], % Second service entity
immediate_local,
10000, 10000, 10000, undefined, undefined, 1, 1, 300,
[]}
Request has been successfully delivered, but the response is lost.
After some time, the sender dies by timeout
I <0.278.0> [cloudi_services_monitor:130]: start_internal [0,cloudi_ping_pong,
[ponger],
10000,"/test/",10000,10000,immediate_local,undefined,
undefined,
{config_service_options,0,undefined,500,300000,false,false,1,
[link],
infinity,
[link],
false},
<<114,181,69,216,211,192,17,226,179,1,44,188,0,0,1,18>>] -> <0.788.0>
I <0.788.0> [cloudi_ping_pong:12]: init ponger
I <0.278.0> [cloudi_services_monitor:130]: start_internal [0,cloudi_ping_pong,
[pinger],
10000,"/test/",10000,10000,immediate_local,undefined,
undefined,
{config_service_options,0,undefined,500,300000,false,false,1,
[link],
infinity,
[link],
false},
<<114,181,69,246,211,192,17,226,179,1,44,188,0,0,1,18>>] -> <0.790.0>
I <0.790.0> [cloudi_ping_pong:16]: init pinger
I <0.792.0> [cloudi_ping_pong:22]: pong request
......
(cc@insider)1> W <0.278.0> [cloudi_services_monitor:216]: Service pid <0.790.0> error: timeout
cloudi_spawn:start_internal[0,cloudi_ping_pong,
[pinger],
10000,"/test/",10000,10000,immediate_local,
undefined,undefined,
{config_service_options,0,undefined,500,300000,
false,false,1,
[link],
infinity,
[link],
false},
<<114,181,69,246,211,192,17,226,179,1,44,188,0,0,
1,18>>]
But if I try send request from cloudi_service_handle_request() - everything ok.
Do you have idea, whats wrong?
Thank you.
Use the results to quantify the improvement after various Ubuntu updates for Ubuntu 12.04.2.
Only internal services would be supported, due to the API compilation requirements and what rebar can support. The C++ dependencies (nif/port) wouldn't be required.
Proper regression tests have been something that keeps getting pushed out. However, problems within the 1.2.1 release demonstrated their absence is causing development/release problems.
To simplify usage of cloudi_core, and avoid problems with testing and releases, cloudi_core needs to start the cloudi_services_internal, cloudi_services_databases, and cloudi_services_messaging Erlang applications, internally, after the top-level startup is ready and cloudi_core is configured. Eventually, these various internal service Erlang applications can be split up into separate Erlang applications for each service, to make everything more granular, and based on the CloudI Service API, but this is the best first step.
defaults to false, this is for internal services only
This is to determine the average latency for using unix domain sockets instead of localhost inet sockets, for external service OS process communication (IPC).
Need to add the functions:
cpg:which_groups(Pid)
cpg:which_groups(Scope, Pid)
cpg:which_groups(Pid, Timeout)
cpg:which_groups(Scope, Pid, Timeout)
This may be combined with the work for #57.
AC_LANG_CALL is considered bad since it doesn't care about types, and it seems to be broken on OSX. On OSX, the zmq_init function is actually shown as _zmq_init, so there is linking specific name mangling in-place. It is considered better to check with source code that includes function arguments, to also test with type information. The offending macro is on line 142 of src/m4/ax_zeromq.m4
When use_client_ip_prefix and/or use_host_prefix are true, the prefixes should be excluded from the filename used for the attachment.
This will utilize the scope script to add a prefix to all external applications and external modules used by CloudI. The prefix "cloudi_x_" will be added to all modules and applications that do not have the prefix "cloudi_", so that will provide a type of automatic namespace that is created before a release is created with reltool.
Separating these Erlang applications into 1 Erlang application per CloudI service will provide better control over Erlang application dependency loading. The change will also eliminate the need to start Erlang applications, until services_add/2 occurs via the CloudI Service API or the CloudI configuration file.
The autoconf m4 macro that checks for a system installation does test the ZeroMQ installation to make sure the proper version exists and is working, but it does not check if the static libraries were installed. The problem occurs on OSX with homebrew. OSX with macports does not have this problem. Need a cross-platform solution to either force a static link for the ZeroMQ library check, or a cross-platform solution for checking that a ZeroMQ static library is present on the filesystem after the ZeroMQ library link/compile check.
sometimes when the cloudi script stop occurs, services exit with reason normal, instead of shutdown, causing a restart to occur while attempting to stop. An example is:
2013-10-18T23:56:07.432254Z WARN (cloudi_services_monitor:246:<0.1059.0>:cloudi@mc1)
Service pid <0.1076.0> error: normal
cloudi_spawn:start_external[13,"tests/hexpi/priv/hexpi",[],
[{"LD_LIBRARY_PATH","api/c/lib/"},
{"DYLD_LIBRARY_PATH","api/c/lib/"}],
tcp,16384,5000,"/tests/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
true,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,129,222,56,59,17,227,170,49,165,222,0,
0,4,24>>]
2013-10-18T23:56:07.455628Z ERROR (cloudi_services_monitor:349:<0.1059.0>:cloudi@mc1)
failed {error,{{nodedown,shutdown},
{gen_server,call,
[{error,shutdown},
{call,1,
[<<1,0>>,
<<"t">>,
<<53,0,0,0,47,116,109,112,47,99,108,111,117,
100,105,95,115,111,99,107,101,116,95,99,
102,101,102,56,49,100,101,51,56,51,98,49,
49,101,51,97,97,51,49,97,53,100,101,48,48,
48,48,48,52,49,56,95,0>>,
<<13,0,0,0,214,111,0,0,86,120,0,0,160,113,0,
0,177,101,0,0,32,229,0,0,56,119,0,0,54,37,
0,0,92,211,0,0,236,71,0,0,9,193,0,0,127,
40,0,0,124,12,0,0,116,161,0,0>>,
<<23,0,0,0,116,101,115,116,115,47,104,101,
120,112,105,47,112,114,105,118,47,104,101,
120,112,105,0>>,
<<1,0,0,0,0>>,
<<151,0,0,0,76,68,95,76,73,66,82,65,
82,89,95,80,65,84,72,61,97,112,105,
47,99,47,108,105,98,47,0,68,89,76,
68,95,76,73,66,82,65,82,89,95,80,65,
84,72,61,97,112,105,47,99,47,108,
105,98,47,0,67,76,79,85,68,73,95,65,
80,73,95,73,78,73,84,95,84,72,82,69,
65,68,95,67,79,85,78,84,61,49,51,0,
67,76,79,85,68,73,95,65,80,73,95,73,
78,73,84,95,80,82,79,84,79,67,79,76,
61,116,99,112,0,67,76,79,85,68,73,
95,65,80,73,95,73,78,73,84,95,66,85,
70,70,69,82,95,83,73,90,69,61,49,54,
51,56,52,0>>]}]}}} restart
cloudi_spawn:start_external[13,"tests/hexpi/priv/hexpi",[],
[{"LD_LIBRARY_PATH","api/c/lib/"},
{"DYLD_LIBRARY_PATH","api/c/lib/"}],
tcp,16384,5000,"/tests/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
true,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,129,222,56,59,17,227,170,49,165,222,0,
0,4,24>>]
2013-10-18T23:56:07.456502Z WARN (cloudi_services_monitor:246:<0.1059.0>:cloudi@mc1)
Service pid <0.1436.0> error: normal
cloudi_spawn:start_external[4,"/usr/bin/ruby1.9.1",
"tests/http/service/service.rb",[],tcp,16384,
5000,"/tests/http/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
false,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,132,4,56,59,17,227,170,49,165,222,0,0,
4,24>>]
2013-10-18T23:56:07.461473Z ERROR (cloudi_services_monitor:349:<0.1059.0>:cloudi@mc1)
failed {error,{{nodedown,noproc},
{gen_server,call,
[{error,noproc},
{call,1,
[<<1,0>>,
<<"t">>,
<<53,0,0,0,47,116,109,112,47,99,108,111,117,
100,105,95,115,111,99,107,101,116,95,99,
102,101,102,56,52,48,52,51,56,51,98,49,49,
101,51,97,97,51,49,97,53,100,101,48,48,48,
48,48,52,49,56,95,0>>,
<<4,0,0,0,26,103,0,0,237,41,0,0,120,25,0,0,
192,155,0,0>>,
<<19,0,0,0,47,117,115,114,47,98,105,110,47,
114,117,98,121,49,46,57,46,49,0>>,
<<30,0,0,0,116,101,115,116,115,47,104,116,
116,112,47,115,101,114,118,105,99,101,47,
115,101,114,118,105,99,101,46,114,98,0>>,
<<94,0,0,0,67,76,79,85,68,73,95,65,80,
73,95,73,78,73,84,95,84,72,82,69,65,
68,95,67,79,85,78,84,61,52,0,67,76,
79,85,68,73,95,65,80,73,95,73,78,73,
84,95,80,82,79,84,79,67,79,76,61,
116,99,112,0,67,76,79,85,68,73,95,
65,80,73,95,73,78,73,84,95,66,85,70,
70,69,82,95,83,73,90,69,61,49,54,51,
56,52,0>>]}]}}} restart
cloudi_spawn:start_external[4,"/usr/bin/ruby1.9.1",
"tests/http/service/service.rb",[],tcp,16384,
5000,"/tests/http/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
false,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,132,4,56,59,17,227,170,49,165,222,0,0,
4,24>>]
2013-10-18T23:56:07.462184Z WARN (cloudi_services_monitor:246:<0.1059.0>:cloudi@mc1)
Service pid <0.1324.0> error: normal
cloudi_spawn:start_external[4,"/usr/bin/python2",
"tests/http/service/service.py",[],tcp,16384,
5000,"/tests/http/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
false,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,131,170,56,59,17,227,170,49,165,222,0,
0,4,24>>]
2013-10-18T23:56:07.467657Z ERROR (cloudi_services_monitor:349:<0.1059.0>:cloudi@mc1)
failed {error,{{nodedown,noproc},
{gen_server,call,
[{error,noproc},
{call,1,
[<<1,0>>,
<<"t">>,
<<53,0,0,0,47,116,109,112,47,99,108,111,117,
100,105,95,115,111,99,107,101,116,95,99,
102,101,102,56,51,97,97,51,56,51,98,49,49,
101,51,97,97,51,49,97,53,100,101,48,48,48,
48,48,52,49,56,95,0>>,
<<4,0,0,0,30,72,0,0,238,65,0,0,181,82,0,0,
140,130,0,0>>,
<<17,0,0,0,47,117,115,114,47,98,105,110,47,
112,121,116,104,111,110,50,0>>,
<<30,0,0,0,116,101,115,116,115,47,104,116,
116,112,47,115,101,114,118,105,99,101,47,
115,101,114,118,105,99,101,46,112,121,0>>,
<<94,0,0,0,67,76,79,85,68,73,95,65,80,
73,95,73,78,73,84,95,84,72,82,69,65,
68,95,67,79,85,78,84,61,52,0,67,76,
79,85,68,73,95,65,80,73,95,73,78,73,
84,95,80,82,79,84,79,67,79,76,61,
116,99,112,0,67,76,79,85,68,73,95,
65,80,73,95,73,78,73,84,95,66,85,70,
70,69,82,95,83,73,90,69,61,49,54,51,
56,52,0>>]}]}}} restart
cloudi_spawn:start_external[4,"/usr/bin/python2",
"tests/http/service/service.py",[],tcp,16384,
5000,"/tests/http/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
false,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,131,170,56,59,17,227,170,49,165,222,0,
0,4,24>>]
2013-10-18T23:56:07.468187Z WARN (cloudi_services_monitor:246:<0.1059.0>:cloudi@mc1)
Service pid <0.1328.0> error: normal
cloudi_spawn:start_external[4,"/usr/bin/java",
"-jar tests/http/service/jar/service.jar",[],tcp,
16384,5000,"/tests/http/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
false,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,131,220,56,59,17,227,170,49,165,222,0,
0,4,24>>]
2013-10-18T23:56:07.471067Z ERROR (cloudi_services_monitor:349:<0.1059.0>:cloudi@mc1)
failed {error,{{nodedown,noproc},
{gen_server,call,
[{error,noproc},
{call,1,
[<<1,0>>,
<<"t">>,
<<53,0,0,0,47,116,109,112,47,99,108,111,117,
100,105,95,115,111,99,107,101,116,95,99,
102,101,102,56,51,100,99,51,56,51,98,49,
49,101,51,97,97,51,49,97,53,100,101,48,48,
48,48,48,52,49,56,95,0>>,
<<4,0,0,0,166,167,0,0,78,91,0,0,76,228,0,0,
147,167,0,0>>,
<<14,0,0,0,47,117,115,114,47,98,105,110,47,
106,97,118,97,0>>,
<<40,0,0,0,45,106,97,114,0,116,101,115,116,
115,47,104,116,116,112,47,115,101,114,118,
105,99,101,47,106,97,114,47,115,101,114,
118,105,99,101,46,106,97,114,0>>,
<<94,0,0,0,67,76,79,85,68,73,95,65,80,
73,95,73,78,73,84,95,84,72,82,69,65,
68,95,67,79,85,78,84,61,52,0,67,76,
79,85,68,73,95,65,80,73,95,73,78,73,
84,95,80,82,79,84,79,67,79,76,61,
116,99,112,0,67,76,79,85,68,73,95,
65,80,73,95,73,78,73,84,95,66,85,70,
70,69,82,95,83,73,90,69,61,49,54,51,
56,52,0>>]}]}}} restart
cloudi_spawn:start_external[4,"/usr/bin/java",
"-jar tests/http/service/jar/service.jar",[],tcp,
16384,5000,"/tests/http/",5000,5000,none,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
false,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,131,220,56,59,17,227,170,49,165,222,0,
0,4,24>>]
2013-10-18T23:56:07.481546Z WARN (cloudi_services_monitor:246:<0.1059.0>:cloudi@mc1)
Service pid <0.1471.0> error: normal
cloudi_spawn:start_external[4,"/usr/bin/python2",
"tests/messaging/messaging_c.py",[],tcp,16384,
5000,"/tests/messaging/python_c/",10000,10000,
immediate_local,
["/cloudi/api/*"],
undefined,
{config_service_options,0,undefined,500,300000,
false,false,cpg_default_scope,false,false,
undefined,1,[],infinity,[],false,false,false},
<<207,239,136,150,56,59,17,227,170,49,165,222,0,
0,4,24>>]
A simple patch for this issue is:
diff --git a/src/lib/cloudi_core/src/cloudi_services_monitor.erl b/src/lib/cloud
index bced7e7..f3e1da4 100644
--- a/src/lib/cloudi_core/src/cloudi_services_monitor.erl
+++ b/src/lib/cloudi_core/src/cloudi_services_monitor.erl
@@ -220,8 +220,9 @@ handle_cast(Request, State) ->
?LOG_WARN("Unknown cast \"~p\"", [Request]),
{noreply, State}.
-handle_info({'DOWN', _MonitorRef, 'process', Pid, shutdown},
- #state{services = Services} = State) ->
+handle_info({'DOWN', _MonitorRef, 'process', Pid, Info},
+ #state{services = Services} = State)
+ when Info =:= shutdown; Info =:= normal ->
case cloudi_x_key2value:find2(Pid, Services) of
{ok, {[ServiceId], #service{service_m = M,
service_f = F,
However, the impact should be checked.
Checking the process queue when necessary, to update the context automatically (internally), assuming nothing else is consuming process messages.
2013-05-28T19:51:03.378057Z ERROR (cloudi_os_spawn:156:<0.105.0>:cloudi@mc1)
stderr (pid 25692):
java.lang.NullPointerException
at org.cloudi.tests.http_req.Task.request(Task.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.cloudi.Function9.invoke(Function9.java:82)
at org.cloudi.API.callback(API.java:695)
at org.cloudi.API.poll_request(API.java:911)
at org.cloudi.API.poll(API.java:979)
at org.cloudi.tests.http_req.Task.run(Task.java:97)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:679)
2013-05-28T19:51:03.379402Z WARN (cloudi_http_cowboy_handler:259:<0.332.0>:clou
di@mc1)
504 GET /tests/http_req/java.xml 8.336 ms: timeout
reltool in R15 assumes the directory name == application name. Not sure yet if there is a way around this problem, but it blocks the release creation for R15 (travis didn't error properly on the install).
** Reason for termination ==
** {function_clause,
[{cloudi_service_db_pgsql,cloudi_service_terminate,
[<<"3D000">>,undefined],
[{file,"src/cloudi_service_db_pgsql.erl"},{line,214}]},
{cloudi_services_internal,terminate,2,
[{file,"src/cloudi_services_internal.erl"},{line,1022}]},
{gen_server,terminate,6,[{file,"gen_server.erl"},{line,722}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
need to avoid the terminate function if the init function exception occurred
Need erlware/relx#57 resolved, so that included_applications usage is ok. The alternative is to remove cloudi_core from the dependencies of cloudi_services_database, cloudi_services_internal, and cloudi_services_messaging, but that can cause issues with rebar compilation (probably only warnings).
Need to provide a min/max process count, and allow the process count to change based on the rate. An internal service is only ramped-down by stopping idle service instances. The check to ramp-down (or ramp-up) occurs on a timer.
OSX locks up the Erlang schedulers on the unix domain socket accept (C) function call. To fix, it probably needs a poll with a spinlock to avoid blocking on an accept, until it is ready.
{{shutdown,{failed_to_start_child,cloudi_logger,eacces}} should have a better error
Fix the odd broken code that is known as ec2nodefinder
Currently, to define/configure a service in CloudI we have to provide a tuple with 13 (for internal services) or 17 (for external services) fields. This makes the service definition difficult to understand when looking at the code.
I would suggest allowing the use of a proplist when defining the services to improve readability. For the key names, we could use the same field names that are currently used in the internal and external records.
An internal service could be defined by a proplist with the following format:
[{prefix, cloudi:service_name_pattern()},
{module, atom() | file:filename()},
{args, list()},
{dest_refresh, cloudi_service_api:dest_refresh()},
{timeout_init, cloudi_service_api:timeout_milliseconds()},
{timeout_async, cloudi_service_api:timeout_milliseconds()},
{timeout_sync, cloudi_service_api:timeout_milliseconds()},
{dest_list_deny, cloudi_service_api:dest_list()},
{dest_list_allow, cloudi_service_api:dest_list()},
{count_process, pos_integer()},
{max_r, non_neg_integer()},
{max_t, cloudi_service_api:seconds()},
{options, cloudi_service_api:service_options_internal()}]
Whereas an external service could be defined in this way:
[{prefix, cloudi:service_name_pattern()},
{file_path, file:filename()},
{args, string()},
{env, list({string(), string()})},
{dest_refresh, cloudi_service_api:dest_refresh()},
{protocol, 'default' | 'local' | 'tcp' | 'udp'},
{buffer_size, 'default' | pos_integer()},
{timeout_init, cloudi_service_api:timeout_milliseconds()},
{timeout_async, cloudi_service_api:timeout_milliseconds()},
{timeout_sync, cloudi_service_api:timeout_milliseconds()},
{dest_list_deny, cloudi_service_api:dest_list()},
{dest_list_allow, cloudi_service_api:dest_list()},
{count_process, pos_integer()},
{count_thread, pos_integer()},
{max_r, non_neg_integer()},
{max_t, cloudi_service_api:seconds()},
{options, cloudi_service_api:service_options_external()}]
The added benefit of using a proplist is that we could have sane defaults for most of the non-essential fields, thus reducing the number of required fields.
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.