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
This commit is contained in:
parent
8436135dc9
commit
7cf82f318e
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue