ReadWriteSafeCache concurrency read-write (#6149)

This commit is contained in:
Andy Zhang 2021-01-08 10:18:49 +08:00 committed by GitHub
parent e0a4c44036
commit 4ae4f0e76a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -52,6 +52,7 @@ Release Notes.
* Fix the priority setting doesn't work of the ALS analyzers.
* Fix bug that `endpoint-name-grouping.yml` is not customizable in Dockerized case.
* Fix bug that istio version metric type on UI template mismatches the otel rule.
* Improve ReadWriteSafeCache concurrency read-write performance
#### UI
* Fix un-removed tags in trace query.

View File

@ -85,10 +85,10 @@ public class ReadWriteSafeCache<T> {
BufferedData<T> tempPointer = writeBufferPointer;
writeBufferPointer = readBufferPointer;
readBufferPointer = tempPointer;
return readBufferPointer.read();
} finally {
lock.unlock();
}
// Call read method outside of write lock for concurrency read-write.
return readBufferPointer.read();
}
}