9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] git/fetch: be more robust
Date: Mon, 26 Jul 2021 02:45:28 +0200	[thread overview]
Message-ID: <0C78F8861F62859962D0700334F86680@felloff.net> (raw)
In-Reply-To: <07AAA303A77F5CCCA03612746744A0DC@eigenstate.org>

so this is like a race condition?

depending how fast the reader is able to process the message?

the other side of the pipeline is reading the hash and then fails to locate
it in git/fs because it has not been indexed yet when it reads too fast?

is this just a theory or is there proof that the problem is
well understood?

 		if(hparse(&want[nref], sp[0]) == -1)
 			sysfatal("invalid hash %s", sp[0]);
-		if (resolveremote(&have[nref], sp[1]) == -1)
+		if (resolveremote(&have[nref], ref[nref]) == -1)
 			memset(&have[nref], 0, sizeof(have[nref]));
-		print("remote %s %H local %H\n", sp[1], want[nref], have[nref]);
 		nref++;


wouldnt it be better to just estrdup() at the print(), then it seems
cleaner and makes the diff smaller... like:

		if (resolveremote(&have[nref], sp[1]) == -1)
 			memset(&have[nref], 0, sizeof(have[nref]));
-		print("remote %s %H local %H\n", sp[1], want[nref], have[nref]);
+		ref[nref] = estrdup(sp[1]);
		nref++

--
cinap

  parent reply	other threads:[~2021-07-26  1:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26  0:23 ori
2021-07-26  0:36 ` [9front] " Anthony Martin
2021-07-26  1:39   ` ori
2021-07-26  0:45 ` cinap_lenrek [this message]
2021-07-26  1:42   ` [9front] " ori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C78F8861F62859962D0700334F86680@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).