Using the original Logica SMPP (precursor to OpenSMPP) code in an SMPP server implementation, it was observed that some threads would occasionally cause 100% CPU load for a 60 second period, when a particular SMPP client tried to connect, but failed because the bind request was deemed invalid.
This particular client seemed to not shut down the TCP session timeously, which caused a race condition that could occasionally lead to Thread.yield() being run in a tight loop in ProcessingThread, waiting for TCP socket shutdown.
During periods of high CPU load, thread dumps showed threads that persisted in this state for ~60 seconds:
java.lang.Thread.State: RUNNABLE
at java.lang.Thread.yield(Native Method)
at com.logica.smpp.util.ProcessingThread.stop(ProcessingThread.java:165)
at com.logica.smpp.Receiver.stop(Receiver.java:234)
at <some code that tries to stop() a Receiver>
The same code still exists in OpenSMPP, and should be fixed (Thread.yield replaced with Thread.sleep) here too.
Using the original Logica SMPP (precursor to OpenSMPP) code in an SMPP server implementation, it was observed that some threads would occasionally cause 100% CPU load for a 60 second period, when a particular SMPP client tried to connect, but failed because the bind request was deemed invalid.
This particular client seemed to not shut down the TCP session timeously, which caused a race condition that could occasionally lead to
Thread.yield()
being run in a tight loop inProcessingThread
, waiting for TCP socket shutdown.During periods of high CPU load, thread dumps showed threads that persisted in this state for ~60 seconds:
The same code still exists in OpenSMPP, and should be fixed (
Thread.yield
replaced withThread.sleep
) here too.Internal issue tracker ref: TP-6228.