diff options
author | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-25 14:40:05 +0000 |
---|---|---|
committer | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-03-25 14:40:05 +0000 |
commit | 20cece4da62126932c8f1639b32c02969449cd19 (patch) | |
tree | 83f5a6d0eefd62f51cfa915829d833071da6f0af | |
parent | fa10a3a24c66e71792810fc808f839f9ff168ea1 (diff) | |
download | zabbix-20cece4da62126932c8f1639b32c02969449cd19.tar.gz zabbix-20cece4da62126932c8f1639b32c02969449cd19.tar.xz zabbix-20cece4da62126932c8f1639b32c02969449cd19.zip |
- [ZBX-343] fixed possible hang of server trapper process (Alexei)
[svn merge -r5517:5519 svn://svn.zabbix.com/branches/1.4]
git-svn-id: svn://svn.zabbix.com/trunk@5520 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | include/common.h | 2 | ||||
-rw-r--r-- | src/zabbix_proxy/proxy.c | 4 | ||||
-rw-r--r-- | src/zabbix_server/server.c | 4 | ||||
-rw-r--r-- | src/zabbix_server/trapper/trapper.c | 6 |
5 files changed, 9 insertions, 8 deletions
@@ -66,6 +66,7 @@ Changes for 1.5: Changes for 1.4.5: + - [ZBX-343] fixed possible hang of server trapper process (Alexei) - [ZBX-341] fixed compilation problem under Tru64/OSF (Alexei) - [ZBX-338] png files for images_oracle.sql script (Sasha) - [ZBX-322] fixed possible incorrect autodiscovery (Sasha) diff --git a/include/common.h b/include/common.h index d08fb5f6..5238b370 100644 --- a/include/common.h +++ b/include/common.h @@ -490,7 +490,7 @@ typedef enum #define AGENT_TIMEOUT 3 #define SENDER_TIMEOUT 60 -#define TRAPPER_TIMEOUT 5 +#define ZABBIX_TRAPPER_TIMEOUT 300 #define SNMPTRAPPER_TIMEOUT 5 #ifndef MAX diff --git a/src/zabbix_proxy/proxy.c b/src/zabbix_proxy/proxy.c index 2c254345..ba870ef3 100644 --- a/src/zabbix_proxy/proxy.c +++ b/src/zabbix_proxy/proxy.c @@ -125,7 +125,7 @@ int CONFIG_UNREACHABLE_POLLER_FORKS = 1; int CONFIG_LISTEN_PORT = 10051; char *CONFIG_LISTEN_IP = NULL; -int CONFIG_TRAPPER_TIMEOUT = TRAPPER_TIMEOUT; +int CONFIG_TRAPPER_TIMEOUT = ZABBIX_TRAPPER_TIMEOUT; /**/ /*int CONFIG_NOTIMEWAIT = 0;*/ int CONFIG_DISABLE_HOUSEKEEPING = 0; @@ -228,7 +228,7 @@ void init_config(void) {"Fping6Location",&CONFIG_FPING6_LOCATION,0,TYPE_STRING,PARM_OPT,0,0}, #endif /* HAVE_IPV6 */ {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30}, - {"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30}, + {"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,300}, {"UnreachablePeriod",&CONFIG_UNREACHABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600}, {"UnreachableDelay",&CONFIG_UNREACHABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600}, {"UnavailableDelay",&CONFIG_UNAVAILABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600}, diff --git a/src/zabbix_server/server.c b/src/zabbix_server/server.c index 395c3d7f..124064b8 100644 --- a/src/zabbix_server/server.c +++ b/src/zabbix_server/server.c @@ -129,7 +129,7 @@ int CONFIG_UNREACHABLE_POLLER_FORKS = 1; int CONFIG_LISTEN_PORT = 10051; char *CONFIG_LISTEN_IP = NULL; -int CONFIG_TRAPPER_TIMEOUT = TRAPPER_TIMEOUT; +int CONFIG_TRAPPER_TIMEOUT = ZABBIX_TRAPPER_TIMEOUT; /**/ /*int CONFIG_NOTIMEWAIT =0;*/ int CONFIG_HOUSEKEEPING_FREQUENCY = 1; @@ -208,7 +208,7 @@ void init_config(void) {"Fping6Location",&CONFIG_FPING6_LOCATION,0,TYPE_STRING,PARM_OPT,0,0}, #endif /* HAVE_IPV6 */ {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30}, - {"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,30}, + {"TrapperTimeout",&CONFIG_TRAPPER_TIMEOUT,0,TYPE_INT,PARM_OPT,1,300}, {"UnreachablePeriod",&CONFIG_UNREACHABLE_PERIOD,0,TYPE_INT,PARM_OPT,1,3600}, {"UnreachableDelay",&CONFIG_UNREACHABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600}, {"UnavailableDelay",&CONFIG_UNAVAILABLE_DELAY,0,TYPE_INT,PARM_OPT,1,3600}, diff --git a/src/zabbix_server/trapper/trapper.c b/src/zabbix_server/trapper/trapper.c index 309da7e6..518245b2 100644 --- a/src/zabbix_server/trapper/trapper.c +++ b/src/zabbix_server/trapper/trapper.c @@ -692,16 +692,16 @@ void process_trapper_child(zbx_sock_t *sock) gettimeofday(&tv, NULL); msec = tv.tv_usec;*/ -/* alarm(CONFIG_TIMEOUT);*/ + alarm(ZABBIX_TRAPPER_TIMEOUT); if(zbx_tcp_recv(sock, &data) != SUCCEED) { -/* alarm(0);*/ + alarm(0); return; } process_trap(sock, data, sizeof(data)); -/* alarm(0);*/ + alarm(0); /* gettimeofday(&tv, NULL); zabbix_log( LOG_LEVEL_DEBUG, "Trap processed in " ZBX_FS_DBL " seconds", |