mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-11-09 07:24:41 +00:00
Resolve deadlock seen after latest changes
* AbstractFrontier
(drainInbound) don't assume current thread will be able to take() full batch; poll() and exit early if other threads have drained queue first
This commit is contained in:
1 parent
f12e940edd
commit
3be9941f76
1 file changed
+4
-1
@@ -473,7 +473,10 @@ public abstract class AbstractFrontier
|
||||
protected void drainInbound() throws InterruptedException {
|
||||
int batch = inbound.size();
|
||||
for(int i = 0; i < batch; i++) {
|
||||
InEvent ev = inbound.take();
|
||||
InEvent ev = inbound.poll();
|
||||
if(ev==null) {
|
||||
break;
|
||||
}
|
||||
synchronized(this) {
|
||||
ev.process();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user