Dave Shield wrote:
On 02/11/06, Josef Moellers <[EMAIL PROTECTED]> wrote:
Can somebody explain to me why, in close_agentx_session(), part of the
session infrastructure is taken down first
(unregister_XXX_by_session()), and _then_ the requests are cleaned up,
rather than the other way round?
Probably because the session infrastructure closedown was implemented
some six years ago, while the removal of delegated requests was added
a couple of years later.
I hope you're not making the erroneous assumption that any of this
software was actually *designed*, are you? Like Topsy, it Just Growed :-)
We're having problems as subtrees are already freed (by
unregister_mibs_by_session()) which are later referenced by
netsnmp_remove_delegated_requests_for_session().
Wouldn't it make more sense to take something down in the reverse order
in which it was constructed?
Sounds logical.
What happens if you reorder things in that way?
Does moving this second block (remove_delegated) to before the
uneregister_by_session block cause your problems to disappear?
Can I ask you to look at the patch included. It's against a quite recent
CVS snapshot. It reverses the cleanup sequences at two points and seems
to fix our problem.
Josef
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
--- net-snmp-5.3.0.1/agent/mibgroup/agentx/master_admin.c.order 2006-03-09
09:06:43.000000000 +0100
+++ net-snmp-5.3.0.1/agent/mibgroup/agentx/master_admin.c 2006-11-03
16:02:12.000000000 +0100
@@ -133,14 +133,6 @@
DEBUGMSGTL(("agentx/master", "close %08p, %d\n", session, sessid));
if (sessid == -1) {
- unregister_mibs_by_session(session);
- unregister_index_by_session(session);
- snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
- SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
- (void*)session);
- if (session->myvoid != NULL) {
- free(session->myvoid);
- }
/*
* The following is necessary to avoid locking up the agent when
* a sugagent dies during a set request. We must clean up the
@@ -154,6 +146,14 @@
netsnmp_remove_delegated_requests_for_session(subsession);
}
}
+ unregister_mibs_by_session(session);
+ unregister_index_by_session(session);
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
+ (void*)session);
+ if (session->myvoid != NULL) {
+ free(session->myvoid);
+ }
return AGENTX_ERR_NOERROR;
}
--- net-snmp-5.3.0.1/agent/mibgroup/agentx/master.c.order 2006-09-20
09:02:32.000000000 +0200
+++ net-snmp-5.3.0.1/agent/mibgroup/agentx/master.c 2006-11-03
16:02:12.000000000 +0100
@@ -244,6 +244,10 @@
* probability is that the whole agent has died somehow.
*/
+ netsnmp_handler_mark_requests_as_delegated(requests,
+
REQUEST_IS_NOT_DELEGATED);
+ netsnmp_set_request_error(cache->reqinfo, requests, /* XXXWWW:
should be index=0 */
+ SNMP_ERR_GENERR);
if (s != NULL) {
netsnmp_transport *t = snmp_sess_transport(s);
close_agentx_session(session, -1);
@@ -257,13 +261,9 @@
} else {
DEBUGMSGTL(("agentx/master", "NULL sess_pointer??\n"));
}
- netsnmp_handler_mark_requests_as_delegated(requests,
-
REQUEST_IS_NOT_DELEGATED);
- netsnmp_set_request_error(cache->reqinfo, requests, /* XXXWWW:
should be index=0 */
- SNMP_ERR_GENERR);
ax_session = (netsnmp_session *) cache->localinfo;
- netsnmp_free_agent_snmp_session_by_session(ax_session, NULL);
netsnmp_free_delegated_cache(cache);
+ netsnmp_free_agent_snmp_session_by_session(ax_session, NULL);
return 0;
}
--- net-snmp-5.3.0.1/agent/snmpd.c.order 2006-11-03 17:16:10.000000000
+0100
+++ net-snmp-5.3.0.1/agent/snmpd.c 2006-11-03 17:18:21.000000000 +0100
@@ -117,6 +117,8 @@
#include <grp.h>
#endif
+#include <sys/resource.h>
+
#ifndef PATH_MAX
# ifdef _POSIX_PATH_MAX
# define PATH_MAX _POSIX_PATH_MAX
@@ -520,6 +522,12 @@
netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
NETSNMP_DS_LIB_APPTYPE, app_name);
+{
+ struct rlimit lim;
+ lim.rlim_cur = RLIM_INFINITY;
+ lim.rlim_max = RLIM_INFINITY;
+ setrlimit(RLIMIT_CORE, &lim);
+}
/*
* Now process options normally.
*/
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders