From 7dc4dd0d107cd5e78f07e445abb2d7269fe3f0a6 Mon Sep 17 00:00:00 2001 From: luoye Date: Sun, 21 Jun 2020 17:52:46 +0800 Subject: [PATCH 1/2] fix refcount issue when adding/removing VIP group 1. Increase VS's refcount when adding one RS 2. Decrease VS's refcount when deleteing one RS 3. Remove VS when its refcount is zero(No RS associated) --- tools/keepalived/keepalived/check/ipvswrapper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/keepalived/keepalived/check/ipvswrapper.c b/tools/keepalived/keepalived/check/ipvswrapper.c index 546fadedd..669f6ed89 100644 --- a/tools/keepalived/keepalived/check/ipvswrapper.c +++ b/tools/keepalived/keepalived/check/ipvswrapper.c @@ -918,6 +918,8 @@ ipvs_group_sync_entry(virtual_server_t *vs, virtual_server_group_entry_t *vsge) } else ipvs_group_range_cmd(IP_VS_SO_SET_ADDDEST, &srule, &drule, vsge); + + ipvs_set_vsge_alive_state(IP_VS_SO_SET_ADDDEST, vsge, vs); } } } @@ -1192,11 +1194,12 @@ ipvs_group_remove_entry(virtual_server_t *vs, virtual_server_group_entry_t *vsge } else ipvs_group_range_cmd(IP_VS_SO_SET_DELDEST, &srule, &drule, vsge); + + ipvs_set_vsge_alive_state(IP_VS_SO_SET_DELDEST, vsge, vs); } } /* Remove VS entry if this is the last VS using it */ - unset_vsge_alive(vsge, vs); if (!is_vsge_alive(vsge, vs)) { if (vsge->range) ipvs_group_range_cmd(IP_VS_SO_SET_DEL, &srule, NULL, vsge); From 02a4fdf9561ae3b798257da453b7e91a16701ca0 Mon Sep 17 00:00:00 2001 From: luoye Date: Wed, 29 Jul 2020 11:39:51 +0800 Subject: [PATCH 2/2] enable coredump generation --- src/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.c b/src/main.c index 999f0d54f..132ec84f6 100644 --- a/src/main.c +++ b/src/main.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "pidfile.h" #include "dpdk.h" #include "conf/common.h" @@ -139,6 +140,14 @@ static int parse_app_args(int argc, char **argv) return ret; } +static void enable_coredump(void) +{ + struct rlimit core_limits; + + core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY; + setrlimit(RLIMIT_CORE, &core_limits); +} + int main(int argc, char *argv[]) { int err, nports; @@ -148,6 +157,8 @@ int main(int argc, char *argv[]) char pql_conf_buf[LCORE_CONF_BUFFER_LEN]; int pql_conf_buf_len = LCORE_CONF_BUFFER_LEN; + enable_coredump(); + /** * add application agruments parse before EAL ones. * use it like the following: