From 2b5e36eb45d74d0849cc393aad239e15133ed9ba Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Tue, 3 Sep 2024 00:14:16 +0000 Subject: [PATCH] wallets: Don't wait for subprocess shutdown after response We send a `stop` RPC call and wait for the subprocess after receiving a `success/ok` message. This is unnecessary because we received a `success` reply already. --- .../WalletShutdownFailedException.java | 24 ------------------- .../bisq/wallets/process/DaemonProcess.java | 9 +------ 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 wallets/core/src/main/java/bisq/wallets/core/exceptions/WalletShutdownFailedException.java diff --git a/wallets/core/src/main/java/bisq/wallets/core/exceptions/WalletShutdownFailedException.java b/wallets/core/src/main/java/bisq/wallets/core/exceptions/WalletShutdownFailedException.java deleted file mode 100644 index 9535efb615..0000000000 --- a/wallets/core/src/main/java/bisq/wallets/core/exceptions/WalletShutdownFailedException.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This file is part of Bisq. - * - * Bisq is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bisq is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bisq. If not, see . - */ - -package bisq.wallets.core.exceptions; - -public class WalletShutdownFailedException extends RuntimeException { - public WalletShutdownFailedException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/wallets/process/src/main/java/bisq/wallets/process/DaemonProcess.java b/wallets/process/src/main/java/bisq/wallets/process/DaemonProcess.java index 65e8055a55..6126692357 100644 --- a/wallets/process/src/main/java/bisq/wallets/process/DaemonProcess.java +++ b/wallets/process/src/main/java/bisq/wallets/process/DaemonProcess.java @@ -19,7 +19,6 @@ import bisq.common.file.FileUtils; import bisq.common.file.LogScanner; -import bisq.wallets.core.exceptions.WalletShutdownFailedException; import bisq.wallets.core.exceptions.WalletStartupFailedException; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -58,13 +57,7 @@ public void start() { @Override public void shutdown() { - try { - invokeStopRpcCall(); - process.waitFor(2, TimeUnit.MINUTES); - } catch (InterruptedException e) { - String processName = process.info().command().orElse(""); - throw new WalletShutdownFailedException("Cannot shutdown " + processName + ".", e); - } + invokeStopRpcCall(); } private void waitUntilReady() {