Ok, here is possible patch but I did't test it at all. Transmitter is changed so it calls pdu.transmit() outside of synchronize block so the transmit sequence don't capture the Transmitter instance monitor. The AbstractSnmpContext.destroy() is changed so it uses new flag which prevents new PDUs to be added tothe context after the destroy is called and awaits for known PDUs to get answers.
I'm still running the tests but while this fixes the deadlock there is the hidden issue with the lib architecture in there related to this deadlock. This deadlock happens in the case when the context was closed before the PDU was sent so if the deadlock will be fixed there will still be the issue: in some cases some PDUs will not be sent to devices due to race condition because the required context is destroyed before the actual data send happens.
I suppose you could delay the destruction of the context until all pending PDUs are sent. That however might leave you with a problem on messages that expect an ack - you could be waiting a while for destroy to happen. You could have a destroyWhenIdle() type method - which fires a callback when complete - or set a ’closing’ flag and accept no new requests... T. On 4 Dec 2018, at 18:25, Zur13 zur13@users.sourceforge.net wrote: I'm still running the tests but while this fixes the deadlock there is...
I'm still running the tests but while this fixes the deadlock there is the hidden issue with the lib architecture in there related to this deadlock. This deadlock happens in the case when the context was closed before the PDU was sent so if the deadlock will be fixed there will still be the issue: in some cases some PDUs will not be sent to devices due to race condition where the required context is destroyed before the actual data send happens.
Thanks for this, if you could supply a diff, that would be great. Tim. On 4 Dec 2018, at 17:10, Zur13 zur13@users.sourceforge.net wrote: If someone interested in the fix I have made one for myself (sorry I can't make the proper patch) and I'm still testing it. There are changes in 2 methods in class: uk.co.westhawk.snmp.stack.Transmitter public void run() { while (me != null) { Pdu cachedPdu = sit(); if (cachedPdu != null) { cachedPdu.transmit(); synchronized (this) { if( pdu == cachedPdu ) { //...
If someone interested in the fix I have made one for myself (sorry I can't make the proper patch) and I'm still testing it. There are changes in 2 methods in class: uk.co.westhawk.snmp.stack.Transmitter public void run() { while (me != null) { Pdu cachedPdu = sit(); if (cachedPdu != null) { cachedPdu.transmit(); synchronized (this) { if( pdu == cachedPdu ) { // I will say this only once.... pdu = null; } } } } } synchronized Pdu sit() { while ((me != null) && (pdu == null)) { try { wait(); } catch...
If someone interested in the fix I have made one for myself (sorry I can't make the proper patch) and I'm still testing it. There are changes in 2 methods in class: uk.co.westhawk.snmp.stack.Transmitter public void run() { while (me != null) { Pdu cachedPdu = sit(); if (cachedPdu != null) { cachedPdu.transmit(); synchronized (this) { if( pdu == cachedPdu ) { // I will say this only once.... pdu = null; } } } } synchronized Pdu sit() { while ((me != null) && (pdu == null)) { try { wait(); } catch...
Hi Team, I am using "snmp6_1.jar" for monitoring. Till now I was using it with Java 8 applications. As we all know Java 8 is end of public updates is announced for Jan 2019. So is there any plan to have a new release of this jar with Java 11 support? Currently jdeprscan for Java 11 showed some deprecated APIs being used in the snmp6_1.jar like “java/util/Observer”, “java/lang/Boolean”, “java/lang/Long”, “java/lang/Integer”. With best Regards, Ritul
Added dependencies so default build immediately.
Old stack version snuck in there.
Creating version 3.0 of the SNMP stack. Added documentation. Added
First commit
First commit
Added beans methods.
fixing jar
Added debug code.
Added visual
Added propertyDialog, testNcdPerfDataBean, testAscendActiveSessionBean.
Added all the new html files.
Because of restart, start with revision 3.0
Added waiting for self option.
Nieuw file for SNMP stack version 3.0
Updated it.
Small correction
Making new SNMP version 3.0. Added documentation, added beans.
Moved the . dir to the end of the CLASSPATH
No longer useful.
First commit
Rescheduled directories, rebuilding CVS tree
Added comment.
Removed all swing stuff. Added doc.
Added package visual
Removed CVS headers
Added testAscendActiveSessionBean.html
In run() test on (me != null). In sit() test also on (me != null).
Updated to improved making of jar and zip file.
In new_value() check the type of the varbind(s), or catch
First commit
Changed title of frame (was copy/paste slip :-)
Added testAnnexModemStatusBean
Added methods getSize() and getElementAt(int index).
First commit
Add javadoc link to varbind.
Good parameters values for a distribution.
Layout change.
Added AnnexModemStatusBean
Changed name of readme file
Removed SWING and HTTPD from CLASSPATH.
Added SWING to CLASSPATH
Added NcdPerfDataBean, AscendActiveSessionBean.
Removed println.
Added DialogChannelStatusBean.
Added frame to One* classes
Changed txt for v30
Changed size() into getSize().
Change JFrame myFrame into Frame myFrame, else it does not work with
Added testDialogChannelStatusBean
Fixed a bug in the conversion to IpAddress. Should add 256 instead of
Thread.destroy() will cause an Exception.
Added property isTimedOut that is set when the Pdu times out.
Added check if (pdu.isTimedOut) to see if the loop has ended.
Changed some incorrect javadoc
Moved to dir distributie
Threads have better name. Moved the transmitters[i].destroy() from
Improved the run method; always test on isRunning(). Removed the
Added text about visual package
First commit
Added extra documentation.
Prepear for version 40.
Do not include the class files.
First commit
Using jdk1.1.8
Added setRetryIntervals().
Added test_threads.java
Updated the jdk or sdk version.
Created v3.3
prefixed /project/packages/ to the CLASSPATH10, so it can finds the
Javadoc is moved from doc -> javadoc
Testing branch.
Moving doc to javadoc.
Added retry intervals.
First commit.
Testing branch.
*** empty log message ***
Testing branch.
First commit.
Test branch.
Changed
Added UsmDiscoveryBean
Created a static error status string array, used in getErrorStatusString().
Pdu.send() now throws PduException instead of EncodingException
Added appetv3.
Remove the list.
Added toBytes(), dumpBytes(), toHexString(), toHex(), areBytesEqual().
First commit.
Changed stack to accomodate Adherent. Some code for v3 added, but lots
First commit.
Pdu.send() throws now PduException instead of EncodingException.
addPdu(Pdu pdu) now throws java.io.IOException, PduException.
Pdu.send() now throws PduException instead of EncodingException.