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...
Original issue reported on code.google.com by jean.deruelle on 24 Apr 2015 at 10:59
Original issue reported on code.google.com by
jean.deruelle
on 24 Apr 2015 at 10:59