mkhludnev commented on a change in pull request #376:
URL: https://github.com/apache/solr/pull/376#discussion_r747812872
##########
File path: solr/core/src/java/org/apache/solr/request/SolrRequestInfo.java
##########
@@ -95,25 +99,33 @@ public static void clearRequestInfo() {
* we expect it to be empty by now because all "set" calls need to be
balanced with a "clear".
*/
public static void reset() {
+ log.trace("reset()");
Deque<SolrRequestInfo> stack = threadLocal.get();
- boolean isEmpty = stack.isEmpty();
+ assert stack.isEmpty() : "SolrRequestInfo Stack should have been cleared.";
while (!stack.isEmpty()) {
SolrRequestInfo info = stack.pop();
- closeHooks(info);
+ info.close();
}
- assert isEmpty : "SolrRequestInfo Stack should have been cleared.";
}
- private static void closeHooks(SolrRequestInfo info) {
- if (info.closeHooks != null) {
- for (Closeable hook : info.closeHooks) {
+ private synchronized void close() {
Review comment:
Reducing synchronized scope to condition seems working. Is it worth to
push into PRs' branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]