Re: [HACKERS] pg_arch.c call to sleep() - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: [HACKERS] pg_arch.c call to sleep()
Date
Msg-id 419CD55C.7010802@dunslane.net
Whole thread Raw
In response to Re: [HACKERS] pg_arch.c call to sleep()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] pg_arch.c call to sleep()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches

Tom Lane wrote:

>Andrew Dunstan <andrew@dunslane.net> writes:
>
>
>>I take this as confirmation that calling pg_usleep is the Right Thing (tm).
>>Here's the patch.
>>
>>
>
>Applied.
>
>
>
>

Darnit, I caught one and not the other. Here's a oneline fix.

cheers

andrew
Index: src/backend/postmaster/pgarch.c
===================================================================
RCS file: /home/cvsmirror/pgsql/src/backend/postmaster/pgarch.c,v
retrieving revision 1.11
diff -c -r1.11 pgarch.c
*** src/backend/postmaster/pgarch.c    17 Nov 2004 17:50:20 -0000    1.11
--- src/backend/postmaster/pgarch.c    18 Nov 2004 16:57:10 -0000
***************
*** 392,398 ****
                                      xlog)));
                      return;        /* give up archiving for now */
                  }
!                 sleep(1);        /* wait a bit before retrying */
              }
          }
      }
--- 392,398 ----
                                      xlog)));
                      return;        /* give up archiving for now */
                  }
!                 pg_usleep(1000000L);    /* wait 1 sec before retrying */
              }
          }
      }

pgsql-patches by date:

Previous
From: "Zeugswetter Andreas DAZ SD"
Date:
Subject: Re: [HACKERS] pg_resetxlog options
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] pg_arch.c call to sleep()