From 4a29d4330f98c20d4efef4a8c3e351a037953b47 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 18 Sep 2023 18:58:21 -0500 Subject: [PATCH] Eventually we need to move on 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. --- .../eu/siacs/conversations/services/XmppConnectionService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 442faea9f..fb38af615 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/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) { } } -- 2.45.2