Skip to content

Commit ab9e24f

Browse files
author
Vladimir Kotal
committed
do not wait for lock when incrementing search term count in suggester
fixes #2593
1 parent 593d7e3 commit ab9e24f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

suggester/src/main/java/org/opengrok/suggest/SuggesterProjectData.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,11 @@ public void incrementSearchCount(final Term term, final int value) {
407407
throw new IllegalArgumentException("Cannot increment search count for null");
408408
}
409409

410-
lock.readLock().lock();
410+
boolean gotLock = lock.readLock().tryLock();
411+
if (!gotLock) { // do not wait for rebuild
412+
return;
413+
}
414+
411415
try {
412416
if (lookups.get(term.field()).get(term.text()) == null) {
413417
return; // unknown term

0 commit comments

Comments
 (0)