[SNMP4J] Problems closing snmp

Frank Fock fock at agentpp.com
Wed Oct 14 23:14:41 CEST 2009


Sorry, I confused the messages. Ok, then if you
get timeouts only either a deadlock occured within
the Snmp or the DefaultUdpTransportMapping or
an exception occured which terminated the transport
mapping listener thread. A deadlock is more likely.
A heap dump or stack traces of the involved threads
would be helpful.

The deadlock can be caused by an async SNMP request
that hangs in its ResponseListener's onResponse method.

Regards,
Frank


Yoryos Valotassios wrote:
> I don't get any NPE, I get ResponseListener triggers where when the
> peerAdress of events passed to the onResponse method is null. Null is
> also all the response pdus i get from this event!
> 
> When this start happens I just try to restart the snmp mechanism. This
> is done within an osgi environment so there is only one call to the
> stop method of the bundle activator that contains the snmp4j stuff.
> The osgi guaranties that there will be one call to this method (at
> least I hope so!) when you try to stop the a bundle.
> 
> Per bundle I have one and only one snmp object created witch I try to
> close at the very end. Actually there isn't any other method call
> after the snmp.close() inside the bundle's stop method and I can see
> from the logs that all the other stuff stopped/shutdown/closed just
> fine.
> 
> --
> Valotassios Yoryos
> GLOMAN S.A.
> 2 Papada str,
> Athens, GR 115 25
> 
> T: +30 210 6985700
> E: valotas at gloman.gr
> 
> 
> 
> On Wed, Oct 14, 2009 at 10:13 PM, Frank Fock <fock at agentpp.com> wrote:
>> What is the code line and class file where the NPE occurs?
>> Are you sure that you are not closing the Snmp instance
>> concurrently from different threads?
>> When is the instance closed? Trigger by?
>>
>> Thanks,
>> Frank
>>
>>
>> Yoryos Valotassios wrote:
>>> I switched to 1.10.1 but the problem still exists. Just had the same
>>> issue after about 10 hours uptime.
>>>
>>>
>>> --
>>> Valotassios Yoryos
>>> GLOMAN S.A.
>>> 2 Papada str,
>>> Athens, GR 115 25
>>>
>>> T: +30 210 6985700
>>> E: valotas at gloman.gr
>>>
>>>
>>>
>>> On Tue, Oct 13, 2009 at 10:29 PM, Frank Fock <fock at agentpp.com> wrote:
>>>> Please update your SNMP4J version to 1.10.1 to solve the
>>>> problem.
>>>>
>>>> Best regards,
>>>> Frank
>>>>
>>>> Yoryos Valotassios wrote:
>>>>> I'm using snmp v1.9.1f. What I do is instantiate an Snmp object and
>>>>> use it for requests to different targets. Every time I want to send a
>>>>> new request I use a ResponseListener in order to get the response as
>>>>> soon as it's ready following the code snippet found at the
>>>>> documentation of the Snmp class.
>>>>>
>>>>> What I've seen (from the logs as I couldn't reproduce the problem on a
>>>>> development machine) is that some times the snmp object just hangs. As
>>>>> I see from the logs the onResponse method of the listener will be
>>>>> called with an event but the given peerAddress is alway null. When the
>>>>> problem starts I can't get a "good" response from any possible target.
>>>>> I am pretty sure that there isn't any connectivity problems as one of
>>>>> the targets I'm using is the machine running the application.
>>>>>
>>>>> The application is osgi based, so I tried to just restart the bundle
>>>>> that handles the snmp stuff (witch contains the snmp4j library). What
>>>>> I noticed is that the osgi enviroment was waiting for the snmp.close()
>>>>> method to finish for some minutes before I terminated the virtual
>>>>> machine and restarted it.
>>>>>
>>>>> The problem does not have any kind of frequency and the only solution
>>>>> right now is a jvm restart. It can happen in 3 days or in 3 hours.
>>>>>
>>>>> --
>>>>> Valotassios Yoryos
>>>>> GLOMAN S.A.
>>>>> 2 Papada str,
>>>>> Athens, GR 115 25
>>>>>
>>>>> T: +30 210 6985700
>>>>> E: valotas at gloman.gr
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

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




More information about the SNMP4J mailing list