Status: Accepted
Owner: jean.deruelle
Labels: Type-Defect Priority-Medium Component-JAIN-SIP
New issue 160 by jean.deruelle: ParseException in NioPipelineParser can
starve out all threads quickly, causing a complete shutdown of message
processing
https://code.google.com/p/jain-sip/issues/detail?id=160
Look at : src/gov/nist/javax/sip/parser/NioPipelineParser.run() and how a
semaphore is acquired but if:
parsedSIPMessage = smp.parseSIPMessage(unparsedMessage.lines.getBytes(),
false, false, null)
throws a ParseException, the semaphore isn't released when the exception
code returns. This caused several complete outages for us until we found
the issue and fixed it.
What we have is:
try {
parsedSIPMessage = smp.parseSIPMessage(unparsedMessage.lines.getBytes(),
false, false, null);
if(unparsedMessage.body.length > 0) {
parsedSIPMessage.setMessageContent(unparsedMessage.body);
}
} catch (ParseException e) {
logger.logError("Problem parsing message " + unparsedMessage);
messagesForCallID.poll(); // move on to the next one
semaphore.release(); // <----- THE FIX
return;
}
where sempahore.release() is the actual change.
Also, you completely ignore the result of trying to acquire the semaphore.
If there is an InterruptedException you just move on and also if you fail
to acquire the semaphore in the 30 second timeout you move on too. Hence,
no semaphore acquired which I can only guess will lead to some really nasty
concurrency bugs. At least it looks like it...
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings