From a9d2de06b5c43a2b9f38937eb76a0f3d9fc23494 Mon Sep 17 00:00:00 2001 From: Eric Work Date: Thu, 9 Oct 2025 20:41:34 -0700 Subject: [PATCH] Fix gpclient disconnect bailing with `client is already running` (#542) The command `gpclient disconnect` should disconnect an already running gpclient connection, but instead bails with `client is already running`. The client is expected to be running since the desired behavior is to disconnect an existing connection. Fix the CLI run logic to not bail when the client is already running and a disconnect operation is in progress. Fixes #533 --- apps/gpclient/src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/gpclient/src/cli.rs b/apps/gpclient/src/cli.rs index dd47000..443e53c 100644 --- a/apps/gpclient/src/cli.rs +++ b/apps/gpclient/src/cli.rs @@ -111,7 +111,7 @@ impl Cli { async fn run(&self) -> anyhow::Result<()> { // check if an instance is running - if self.is_running().await { + if !matches!(self.command, CliCommand::Disconnect(_)) && self.is_running().await { bail!("Another instance of the client is already running"); }