Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a separate timeout parameter for vrrp_script checks #6

Closed
wants to merge 1 commit into from

Conversation

jfharden
Copy link

I've added a timeout parameter to the vrrp check scripts which allow you to have the check timeout different to the interval.

To explain the reasoning: We wanted to have check scripts time out faster than our check interval. Doing the check we need to perform is a little load intensive and so we don't want to perform it every few seconds. With this patch we set an interval of 60 seconds but a timeout of 5 seconds (if the check takes more than a few seconds then the service is not working correctly).

@jfharden jfharden closed this Aug 17, 2012
@jfharden
Copy link
Author

I've just realised this should default to the interval if a timeout hasn't been specified to keep the current behaviour. I'll fix this and resubmit.

@kuaikuai kuaikuai mentioned this pull request Jul 23, 2015
@boucho-o boucho-o mentioned this pull request Aug 17, 2018
MiaoheLin added a commit to MiaoheLin/keepalived that referenced this pull request Mar 8, 2019
It's unsafe to use syslog in signal_handler,it may cause deadlock:
#0  0x00007f7d1242248c in __lll_lock_wait_private () from /lib64/libc.so.6
acassen#1  0x00007f7d1239e3cd in _L_lock_15626 () from /lib64/libc.so.6
acassen#2  0x00007f7d1239b4d3 in malloc () from /lib64/libc.so.6
acassen#3  0x00007f7d1238da5a in open_memstream () from /lib64/libc.so.6
acassen#4  0x00007f7d1240e32a in __vsyslog_chk () from /lib64/libc.so.6
acassen#5  0x00007f7d1240e922 in __syslog_chk () from /lib64/libc.so.6
acassen#6  0x000055691ddd60bf in syslog (__fmt=0x55691dddeb6f "%s", __pri=6) at /usr/include/bits/syslog.h:31
acassen#7  vlog_message (facility=6, format=<optimized out>, args=args@entry=0x7ffe4c1b8900) at logger.c:50
acassen#8  0x000055691ddd6184 in log_message (facility=facility@entry=6, 
    format=format@entry=0x55691dde5d50 "BUG - write to signal_pipe[1] error %s - please report") at logger.c:59
acassen#9  0x000055691ddd5805 in signal_handler (sig=1) at signals.c:100
acassen#10 <signal handler called>
acassen#11 0x00007f7d1242248a in __lll_lock_wait_private () from /lib64/libc.so.6
acassen#12 0x00007f7d1239e3cd in _L_lock_15626 () from /lib64/libc.so.6
acassen#13 0x00007f7d1239b4d3 in malloc () from /lib64/libc.so.6
acassen#14 0x00007f7d1238da5a in open_memstream () from /lib64/libc.so.6
acassen#15 0x00007f7d1240e32a in __vsyslog_chk () from /lib64/libc.so.6
acassen#16 0x00007f7d1240e922 in __syslog_chk () from /lib64/libc.so.6
acassen#17 0x000055691ddd60bf in syslog (__fmt=0x55691dddeb6f "%s", __pri=6) at /usr/include/bits/syslog.h:31
acassen#18 vlog_message (facility=6, format=<optimized out>, args=args@entry=0x7ffe4c1b9380) at logger.c:50
acassen#19 0x000055691ddd6184 in log_message (facility=facility@entry=6, 
    format=format@entry=0x55691dde5d50 "BUG - write to signal_pipe[1] error %s - please report") at logger.c:59
acassen#20 0x000055691ddd5805 in signal_handler (sig=17) at signals.c:100
acassen#21 <signal handler called>
acassen#22 0x00007f7d12398de4 in _int_malloc () from /lib64/libc.so.6
acassen#23 0x00007f7d1239bf04 in calloc () from /lib64/libc.so.6
acassen#24 0x00007f7d13e5f409 in __nlmsg_alloc () from /lib64/libnl-3.so.200
acassen#25 0x00007f7d13e5f846 in nlmsg_convert () from /lib64/libnl-3.so.200
acassen#26 0x00007f7d13e61daf in nl_recvmsgs_report () from /lib64/libnl-3.so.200
acassen#27 0x00007f7d13e624a9 in nl_recvmsgs () from /lib64/libnl-3.so.200
acassen#28 0x00007f7d13e62511 in nl_wait_for_ack () from /lib64/libnl-3.so.200
acassen#29 0x00007f7d14073ad0 in genl_ctrl_probe_by_name () from /lib64/libnl-genl-3.so.200
acassen#30 0x00007f7d14073ceb in genl_ctrl_resolve () from /lib64/libnl-genl-3.so.200
acassen#31 0x000055691dda0b55 in ipvs_nl_send_message (msg=msg@entry=0x556924f077a0, 
    func=func@entry=0x55691dda0b00 <ipvs_nl_noop_cb>, arg=arg@entry=0x0) at libipvs.c:302
acassen#32 0x000055691dda515f in ipvs_add_laddr (svc=0x55692fc2ac10, laddr=0x5569359d34e0) at libipvs.c:930
acassen#33 0x000055691dd9d273 in ipvs_talk (cmd=cmd@entry=1168, daemonrule=daemonrule@entry=0x0, 
    ignore_error=ignore_error@entry=false) at ipvswrapper.c:255
acassen#34 0x000055691dd9d614 in ipvs_laddr_group_cmd (cmd=cmd@entry=1168, laddr_group=laddr_group@entry=0x556932f1b4e0)
    at ipvswrapper.c:626
acassen#35 0x000055691dd9f24a in ipvs_laddr_cmd (vs=0x55692fc2ac10, cmd=1168) at ipvswrapper.c:804
acassen#36 ipvs_cmd (cmd=cmd@entry=1168, vs=vs@entry=0x556931f77e70, rs=rs@entry=0x0) at ipvswrapper.c:874
acassen#37 0x000055691dd9b610 in init_service_laddr (vs=0x556931f77e70) at ipwrapper.c:672
acassen#38 init_service_vs (vs=0x556931f77e70) at ipwrapper.c:762
acassen#39 0x000055691dd9baa1 in init_services () at ipwrapper.c:815
acassen#40 0x000055691dd8dc45 in start_check () at check_daemon.c:277
---Type <return> to continue, or q <return> to quit---
acassen#41 0x000055691dd8dfe5 in reload_check_thread (thread=<optimized out>) at check_daemon.c:399
acassen#42 0x000055691ddd3bde in thread_call (thread=0x7ffe4c1ba010) at scheduler.c:963
acassen#43 launch_scheduler () at scheduler.c:986
acassen#44 0x000055691dd8e1af in start_check_child () at check_daemon.c:522
acassen#45 0x000055691dd89340 in start_keepalived () at main.c:337
acassen#46 keepalived_main (argc=2, argv=<optimized out>) at main.c:1064
acassen#47 0x00007f7d12338455 in __libc_start_main () from /lib64/libc.so.6
acassen#48 0x000055691dd879fe in _start ()
I wonder if we can use fprintf instead of log_message ? fprintf is safe in signal handler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant