git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Updated PATCH 1/2] Report exec errors from run-command

From
Erik Faye-Lund <kusmabite@googlemail.com>
Date
Dec 30, 2009, 13:47 UTC
Message-ID
<40aa078e0912300547r407efb74xb821345a54a87277@mail.gmail.com>
In-Reply-To
<1262170338-11574-2-git-send-email-ilari.liusvaara@elisanet.fi>

On Wed, Dec 30, 2009 at 11:52 AM, Ilari Liusvaara <ilari.liusvaara@elisanet.fi> wrote:

Show 6 quoted lines
> +static inline void force_close(int fd)
> +{
> +       while (close(fd) < 0 && errno != EBADF)
> +               ; /* No-op */
> +}
> +

According to http://linux.die.net/man/2/close, close can set errno to EBADF, EINTR, or EIO. Currently, you're retrying on EINTR and EIO. When we get EIO, are you sure it makes sense to retry? I'd imagine that error would most likely just repeat itself, leading to an infinite loop. How about "while (close(fd) < 0 && errno == EINTR)" instead? I've seen other functions (like xread in wrapper.c) only retry on those errors that it expects. In xreads case, it's not retrying on EIO.

Perhaps it's OK still, since force_close() is only used on pipes. I don't know if closing a pipe can generate EIO or not.

-- 
Erik "kusma" Faye-Lund
Previous: Ilari LiusvaaraNext: Tarmigan
Message 3 of 13 in “Improve remote helpers exec error reporting”
  1. 0/2 Improve remote helpers exec error reportingIlari Liusvaara, Dec 30, 2009
  2. 1/2 Report exec errors from run-commandIlari Liusvaara, Dec 30, 2009
  3. Erik Faye-LundDec 30, 2009
  4. TarmiganDec 31, 2009
  5. Ilari LiusvaaraDec 31, 2009
  6. TarmiganDec 31, 2009
  7. 2/2 Improve transport helper exec failure reportingIlari Liusvaara, Dec 30, 2009
  8. Johannes SixtDec 31, 2009
  9. Ilari LiusvaaraDec 31, 2009
  10. Johannes SixtDec 31, 2009
  11. Ilari LiusvaaraDec 31, 2009
  12. Johannes SixtDec 31, 2009
  13. Johannes SixtJan 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.