close Warning: Can't synchronize with repository "(default)" (The repository directory has changed, you should resynchronize the repository with: trac-admin $ENV repository resync '(default)'). Look in the Trac log for more information.

Opened 15 years ago

Closed 15 years ago

Last modified 11 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 by rainer, 15 years ago

Resolution: → fixed
Status: new → closed

Believed to be fixed by changeset [391],

Note: See TracTickets for help on using tickets.