travisghansen / fanout Goto Github PK
View Code? Open in Web Editor NEWA simple fanout pubsub message server
License: MIT License
A simple fanout pubsub message server
License: MIT License
Running the commands:
./fanout --run-as=storage:storage --debug-level=3
./fanout --debug-level=3
./fanout
(and possibly others)
Hit Ctrl-Z (background job) and then fg causes:
[1353544671] ERROR: epoll_wait: Interrupted system call
[1]+ Exit 1 ./fanout
Basically fanout can't background...
ERROR: epoll_wait: Interrupted system call
This happens to, I think, suspending/resuming my machine.
The solution: http://stackoverflow.com/a/6870391/952263
Looks like there are various ways to clean it up..
Program received signal SIGPIPE, Broken pipe.
0x00cf2402 in __kernel_vsyscall ()
(gdb) bt
(gdb) bt full
#0 0x00cf2402 in __kernel_vsyscall ()
No symbol table info available.
#1 0x001e34a1 in send () from /lib/libc.so.6
No symbol table info available.
#2 0x0804a526 in client_write (c=0x80e3ae8, data=0x80efbd8 "1349006458\n") at fanout.c:853
sent = -1073750152
#3 0x0804a6ef in client_process_input_buffer (c=0x80e3ae8) at fanout.c:882
line = 0x8086280 "ping"
message = 0x80efbd8 "1349006458\n"
action = 0xbfffe098 "\005"
channel = 0x804bbb7 "DEBUG"
i = 4
#4 0x08049d3f in main (argc=11, argv=0xbfffe764) at fanout.c:566
srvsock = 7
epollfd = 8
nfds = 1
efd = 1039
n = 0
res = 5
portno = 80
optval = -1073748208
optlen = 4
listen_backlog = 25
max_events = 25
pidfile = 0x0
buffer = "ping\n", '\000' <repeats 1019 times>
pwd = 0x2669b4
grp = 0x266934
user = 0xbfffe8c6 "sparklefan"
group = 0xbfffe8d1 "sparklefan"
user_id = 102
group_id = 104
ev = {events = 1, data = {ptr = 0x5fb, fd = 1531, u32 = 1531, u64 = 20497748600030715}}
events = 0xbfffe0b0
client_i = 0x80e3ae8
client_tmp = 0x80edd08
clilen = 28
serv_addr = {sin6_family = 10, sin6_port = 20480, sin6_flowinfo = 0, sin6_addr = {in6_u = {
u6_addr8 = '\000' <repeats 15 times>, u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, u6_addr32 = {0, 0, 0,
0}}}, sin6_scope_id = 0}
cli_addr = {sin6_family = 10, sin6_port = 45760, sin6_flowinfo = 0, sin6_addr = {in6_u = {
u6_addr8 = "\000\000\000\000\000\000\000\000\000\000\377\377g\367\206;", u6_addr16 = {0, 0, 0, 0, 0,
65535, 63335, 15238}, u6_addr32 = {0, 0, 4294901760, 998700903}}}, sin6_scope_id = 0}
c = -1
option_index = 0
calculated_client_limit = 7984
long_options = {{name = 0x804b390 "port", has_arg = 1, flag = 0x0, val = 0}, {name = 0x804b395 "daemon",
has_arg = 0, flag = 0x804d4b4, val = 1}, {name = 0x804b39c "logfile", has_arg = 1, flag = 0x0,
val = 0}, {name = 0x804b3a4 "pidfile", has_arg = 1, flag = 0x0, val = 0}, {
name = 0x804b3ac "debug-level", has_arg = 1, flag = 0x0, val = 0}, {name = 0x804b3b8 "help",
has_arg = 0, flag = 0x0, val = 0}, {name = 0x804b3bd "client-limit", has_arg = 1, flag = 0x0, val = 0},
{name = 0x804b3ca "run-as", has_arg = 1, flag = 0x0, val = 0}, {name = 0x804b3d1 "max-logfile-size",
has_arg = 1, flag = 0x0, val = 0}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
Hi,
I am package fanout as rpm for CentOS 7. so far I have just used the init script. But I guess it is time to use systemd unit files.
Did you create one already I can use?
Are you interested in a pull request for the rpm spec-file?
Would you please add a command line parameter to bind to specific IP (instead of just 0.0.0.0)?
I notice there is also some IPv6 activity in the issues, too, so maybe an
-ip4
and an
-ipv6
option?
When starting up on 12.04 x64 ubuntu the pidfile variable isnt set to null, so when it comes to forking off the to the background it tries to write to the pidfile and seg faults:
/export/src/external/fanout$ ./fanout --port=12345 --daemon
Segmentation fault (core dumped)
Simple fix:
index b78e9a8..7fa66b2 100644
--- a/fanout.c
+++ b/fanout.c
@@ -157,7 +157,7 @@ int main (int argc, char *argv[])
socklen_t optlen = sizeof(optval);
u_int listen_backlog = 25;
u_int max_events = 25;
Hello,
Please can fanout listen on IPv6 sockets? Currently it only seems to listen for IPv4 connections.
Thanks
I wanted to run mine on a high port 10000+, but found the size of the variable used for reading this was actually 1 short of what it should be (in the options parsing components), i've modified mine and seems to work fine.
diff --git a/fanout.c b/fanout.c
index 6e041ad..e91ce11 100644
--- a/fanout.c
+++ b/fanout.c
@@ -319,7 +319,7 @@ xit\n");
exit (EXIT_FAILURE);
}
e = getaddrinfo (NULL, buf, &hints, &ai);
Good stuff, thanks for the work. Do you think you could create an official PPA for fanout? After the changes from @elliotkendall for debian that's actually really easy. I created one for my purposes, but I'd much rather have this in the hands of the official owner.
My PPA here (just for Ubuntu precise):
https://launchpad.net/~binwiederhier/+archive/fanout
Changes to your repo: binwiederhier@855f050
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.