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

Re: pread() over NFS (again) [1.5.5.4]

From
Christian Holtje <docwhat@gmail.com>
Date
Jun 27, 2008, 13:54 UTC
Message-ID
<590C8EE3-B909-4EE5-8EFA-F5B9031A8C05@gmail.com>
In-Reply-To
<65688C06-BB6A-4E95-A4B9-A1A7C206BE2E@sent.com>
On Jun 26, 2008, at 7:36 PM, logank@sent.com wrote:
Show 20 quoted lines
> diff --git a/index-pack.c b/index-pack.c
> index 5ac91ba..85c8bdb 100644
> --- a/index-pack.c
> +++ b/index-pack.c
> @@ -313,7 +313,14 @@ static void *get_data_from_pack(struct  
> object_entry *obj)
> 	src = xmalloc(len);
> 	data = src;
> 	do {
> +		// It appears that if multiple threads read across NFS, the
> +		// second read will fail. I know this is awful, but we wait for
> +		// a little bit and try again.
> 		ssize_t n = pread(pack_fd, data + rdy, len - rdy, from + rdy);
> +		if (n <= 0) {
> +			sleep(1);
> +			n = pread(pack_fd, data + rdy, len - rdy, from + rdy);
> +		}
> 		if (n <= 0)
> 			die("cannot pread pack file: %s", strerror(errno));
> 		rdy += n;

This does work. But the "unpacking objects" phase becomes very slow. I had 86 objects and I could see every time it did a sleep because the counter would wait a second (or more) before the next object was unpacked.

Ciao!
Previous: Christian Holtje
Message 16 of 16 in “pread() over NFS (again) [1.5.5.4]”
  1. Christian HoltjeJun 26, 2008
  2. Shawn O. PearceJun 26, 2008
  3. Junio C HamanoJun 26, 2008
  4. Shawn O. PearceJun 26, 2008
  5. Christian HoltjeJun 26, 2008
  6. Junio C HamanoJun 26, 2008
  7. Shawn O. PearceJun 26, 2008
  8. logank@sent.comJun 26, 2008
  9. Junio C HamanoJun 26, 2008
  10. J. Bruce FieldsJun 27, 2008
  11. Trond MyklebustJun 27, 2008
  12. Shawn O. PearceJun 30, 2008
  13. Nicolas PitreJun 30, 2008
  14. J. Bruce FieldsJun 27, 2008
  15. Christian HoltjeJun 27, 2008
  16. Christian HoltjeJun 27, 2008

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.