From 02a2fcbbc9f34922928f506a58ca301abee49a9f Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Tue, 16 Jun 2020 13:37:42 -0700 Subject: [PATCH] Don't try to cleanup data in client when FIFO doesn't appear. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think it was in error to go for a lock on the data and clear it — even if it's data the client had set — when we timeout waiting for the named pipe to appear. If the named pipe never appeared, then something is likely really wrong with the server anyway, and as such, we might as well expect the server to do the cleanup. --- bean-query-daemon-lib.pl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bean-query-daemon-lib.pl b/bean-query-daemon-lib.pl index 089f163..dd90e49 100644 --- a/bean-query-daemon-lib.pl +++ b/bean-query-daemon-lib.pl @@ -32,12 +32,7 @@ sub BeancountQuerySubmit($;$) { my $cnt = 0; while (not defined $BEANCOUNT_QUERY{fifoName}) { sleep 1; - if ($cnt++ >= (5 * 60)) { - (tied %BEANCOUNT_QUERY)->shlock; - $BEANCOUNT_QUERY{question} = $BEANCOUNT_QUERY{format} = undef; - (tied %BEANCOUNT_QUERY)->shunlock; - die "Unable to initiate query to beancount server\n"; - } + die "Unable to initiate query to beancount server\n" if ($cnt++ >= (5 * 60)); } unless (-p $BEANCOUNT_QUERY{fifoName}) { (tied %BEANCOUNT_QUERY)->shlock;