未验证 提交 7cf82f31 编写于 作者: X xuxiawei 提交者: GitHub

Fix incorrect use of ReentrantLock in GRPCExporter (#8177)

fix that an imse (IllegalMonitorStateException) exception will be thrown when finally releasing the lock when an exception occurs in lock() locking
上级 8436135d
......@@ -104,8 +104,8 @@ public class GRPCExporter extends MetricFormatter implements MetricValuesExportS
public void fetchSubscriptionList() {
final long currentTimeMillis = System.currentTimeMillis();
if (currentTimeMillis - lastFetchTimestamp > FETCH_SUBSCRIPTION_PERIOD) {
fetchListLock.lock();
try {
fetchListLock.lock();
if (currentTimeMillis - lastFetchTimestamp > FETCH_SUBSCRIPTION_PERIOD) {
lastFetchTimestamp = currentTimeMillis;
SubscriptionsResp subscription = blockingStub.withDeadlineAfter(10, TimeUnit.SECONDS)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册