What is the purpose of the change
- The current approach like below, will swallow the
InterruptedException and rise an IllegalMonitorStateException. This problem will affect the ’exception monitor data’ and performance.
try{
try{
lock.lockInterruptibly();
// do something
}finally {
lock.unlock();
}
}catch (Exception e){
// error log
}
当前使用方式造成的问题是:lock.lockInterruptibly() 抛出异常的话会仍然会调用 finally 中的代码块lock.unlock、lock.unlock会抛出异常并被catch` 捕获,由此造成异常监控不准确问题,并对性能有轻微影响。
- In
ProcessQueue#fillProcessQueueInfo, if an InterruptedException is thrown by #lockInterruptibly, then a RuntimeException IllegalMonitorStateException will be throw from fillProcessQueueInfo because the invoke of #unlock in finally code block.
ProcessQueue#fillProcessQueueInfo中:如果调用#lockInterruptibly 时抛出检查异常InterruptedException、则会导致调用#unlock并由此抛出运行异常IllegalMonitorStateException并在ProcessQueue#fillProcessQueueInfo抛出。
Brief changelog
Details in the pr that refers to this issue.