Opened 10 years ago

Closed 10 years ago

Last modified 6 years ago

#288 closed defect (fixed)

The --with-gpg option can cause startup to hang

Reported by: rainer Owned by: rainer
Priority: major Milestone: 3.0.2
Component: main Version:
Keywords: Cc:

Description

As reported by Andy Jack, the --with-gpg option may cause startup to hang with high cpu load. Apparently the parent process, while trying to read from the pipe, would starve the child such that it never writes. The following patch was provided by Andy Jack:

--- a/src/sh_gpg.c 2011-12-05 04:47:52.000000000 -0500
+++ b/src/sh_gpg.c      2012-02-09 15:48:57.057198707 -0500
@@ -859,6 +859,7 @@
 
   if (ferror(source.pipe) && errno == EAGAIN) 
     {
+      retry_msleep(0,10); /* sleep 10 ms to avoid starving the gpg child writing to the pipe */
       clearerr(source.pipe);
       goto xagain;
     }
@@ -937,6 +938,7 @@
 
   if (ferror(source.pipe) && errno == EAGAIN) 
     {
+      retry_msleep(0,10); /* sleep 10 ms to avoid starving the gpg child writing to the pipe */
       clearerr(source.pipe);
       goto yagain;
     }

Change History (1)

comment:1 Changed 10 years ago by rainer

Resolution: fixed
Status: newclosed

Believed to be fixed by changeset [391],

Note: See TracTickets for help on using tickets.