Eventually we need to move on

Stephen Paul Weber created

If the timeouts fail and we just get hung, twice as long as the
configured timeout, something has gone horribly wrong and let's just
move on so as not to hang the executor.

Change summary

src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 3 
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

src/main/java/eu/siacs/conversations/services/XmppConnectionService.java 🔗

@@ -101,6 +101,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
@@ -1864,7 +1865,7 @@ public class XmppConnectionService extends Service {
                                             openGraphBuilder = openGraphBuilder.jsoupProxy(new JsoupProxy("127.0.0.1", 8118));
                                         }
                                         openGraphBuilder.build().parse(link.toString());
-                                        waiter.acquire();
+                                        waiter.tryAcquire(10L, TimeUnit.SECONDS);
                                     }
                                 } catch (final IOException | InterruptedException e) {  }
                             }