Hi all,
 
I develop snmp agent which use agentX in Linux.
 
 
I found a SNMP locking problem.
 
1. which kind of locking ?
    a. Every snmp get/set/getnext pdu to snmpd are discarded.
    b. But, snmpd shows no problem with processing any signal.
    c. It looks like main loop is also OK.
    d. I am sure that snmpd is not in infinite loop status when this problem occur.
 
2. when this problem occur ?
    a. send a lot of snmpset pdu periodically to sub-agent 'A'. (I think this item is necessary
        to make this problem)
    b. Also, send a lot of snmp getnext/getbulk pdu to sub-agent 'A'
    c. do 'link down' and 'link up' between master agent and sub-agent 'A' continuously.
        This causes master agent calls close_agentx_session() and open_agentx_session()
        periodically. (in 'link down' status, no ping connection between master and sub-agent) 
    d. Then, some time, SNMP locking problem occur. (randomly) Some times, I have to
        do 'link down' and 'link up' more than 30 times to see this problem. But, some times,
        I see this problem with only 1 or 2 'link down' and 'link up' .
    e. mainly, this locking problem occur when do 'link down' command. (this means
        locking problem occur when snmpd calls close_agentx_session())
    f.  only one remedy to this locking problem is 'kill master agent, and restart it'
 
3. what did I do to solve this problem ?
    a. I removed following two lines from file agent/snmp_agent.c
        *** agent/snmp_agent.c
        *** line 3326
        int
        netsnmp_remove_delegated_requests_for_session(netsnmp_session *sess)
       {
           netsnmp_agent_session *asp;
           int count = 0;
 
           for (asp = agent_delegated_list; asp; asp = asp->next) {
           /*
            * check each request
            */
               netsnmp_request_info *request;
               for(request = asp->requests; request; request = request->next) {
                /*
                 * check session
                 */
                    netsnmp_assert(NULL!=request->subtree);
-                    if(request->subtree->session != sess)
-                        continue;
 
                     /*
                      * matched! mark request as done
                      */
                     netsnmp_request_set_error(request, SNMP_ERR_GENERR);
                     ++count;
                }
            }
      b. because of removing two lines above, it seems, locking problem is solved.
          but, this solution causes all delegated snmp set requests to any sub-agent
          return error when one of sub-agent disconnected. but, this new small bug
          is much better than SNMP locking problem.
 
 
So, is there somebody who has any idea about my SNMP locking problem ?
 
I am not sure my remedy is fine.
 
Thanks in advance.
 
Regards,
 
Won-Sik
      
 
 
 
 

Reply via email to