[AGENT++] AgentX++ suagent commiterror let the RowStatus in detroy(6); the row is block forever!

Frank Fock fock at agentpp.com
Fri Nov 5 01:15:01 CET 2010


Hi Claus,

Please find my comments inline:

On 04.11.2010 23:45, Claus Klein wrote:
>
> On 03.11.2010, at 23:23, Frank Fock wrote:
>
>
> I know, but there is also a Bug at the agentpp site:
> I run in deadlocks with my tests, and the reason is the missing cleanup
> request!

The CLEANUP request must be sent by the master agent
(in any case)!

> (The net-snmp agentx master does not like to receive the deregister
> request before see the commit response)
>
OK, but the AgentX protocol does not require to send
the deregister PDU after sending the commit response.
I think that is a bug in NET-SNMP.

> That deadlock in that situation must be prevented on the agentX++ site.
> The master close the session, but the client does wait forever.
>

Are you sure that there is a deadlock in AgentX++. Can you send
me a thread stack info on the threads blocking each other?


>>
>
> Hi Frank,
> you are right, it is not possible to use RowStatus to create a row
> within a real shared table!
>
> But still there is a problem about the handling.
>
> The default while code generation is AgentXSharedTable.
> And if the Table has a rowStatus, the index is not allocated, but
> deallocated while creation with RowStatus.
> At leased, that should be prevented in generated code, or not?

Mmmh, indexes do not need to be allocated. This is fully optional.
It is reasonable if the RowStatus is a simple number with no
special meaning.

Deallocating an index which has never been allocated does not
make any harm.

Nevertheless, I would also prefer a symmetric implementation.
Such an implementation can be found, by using a special
snmpRowStatus subclass for shared tables which uses
allocate_index instead add_row.

The bug, that a row with an inconsistent RowStatus value
could not be destroyed has been fixed in snmpRowStatus.

Best regards,
Frank

> i.e.:
>
> //--AgentGen BEGIN=netSnmpHostsEntry::is_transition_ok
> if(requestedStatus != rowDestroy) // prevent creation! ck
> {
> std::cerr << "XXX netSnmpHostsEntry::is_transition_ok(" << currentStatus
> << " -> "
> << requestedStatus << ") This is not allowed!" << std::endl;
> return SNMP_ERROR_INCONSIST_VAL;
> }
> //--AgentGen END
>
>
>
> And last but not leased, the net-snmp does response this deallocte
> request with an error, which is correct!
>
> With regards,
> Claus
>
>
>
>

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list