From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aYQ5V-00012S-Al for mharc-grub-devel@gnu.org; Tue, 23 Feb 2016 22:26:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59466) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYQ5R-0000zh-RQ for grub-devel@gnu.org; Tue, 23 Feb 2016 22:26:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYQ5O-0000Zc-JI for grub-devel@gnu.org; Tue, 23 Feb 2016 22:26:01 -0500 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:36832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYQ5O-0000Y1-7a for grub-devel@gnu.org; Tue, 23 Feb 2016 22:25:58 -0500 Received: by mail-lf0-x22f.google.com with SMTP id 78so3386011lfy.3 for ; Tue, 23 Feb 2016 19:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=ZTsimiKE/VzNEqcDclqtVMAMzfq8c4Zwo0KJ1nDQwSU=; b=cTYfWIjYsNre3bR4Fotzd3npMgIc8GQiFiH64zgVoQUo1djImc7uyHxKld1hqPI8iD H9KQ8+RuncqmvWqvCABqndtt3o3BMmq63RyHhobYSMpSuifs94pUz/AnwndzoLqxKtKY ORkxLVfnnfHI1J5lhuIOfT4hYgYHS4qchatU2RWWnNtrIlkDVSAsFw1VVI9l9ChMURWX dbKTbyZM3dtfDgmCcvyK7hvVPGyR8ORumGX6nTGypiGSK2+veb+7ATiQkFrkCBEt0TMj sv6SPCUuOkeCoisn+FPAWj8mXBPaW0TlfI9gaH0s+sUMEPNhgTeFFnzmocFIWZjqlmhK p6jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ZTsimiKE/VzNEqcDclqtVMAMzfq8c4Zwo0KJ1nDQwSU=; b=Mt9GIbS0jEcZNgUcHkXyNubA3YZACJeZbs3GvCtBmKn1qNzx5v1BT7HZvcmqr8oI+m vbjA01RLKGsRSwQPUjaqVRFQRw0f8gP2+eOurJ/ANoLo0UHVlzNwZFJTiv//Mh/P/3G3 HXJfDrM6pUyjVgCgmSChaziTTeU3u8LOhGMTwIkJkBfzHlomXed5LP3znIm6EC9E2NSk 93udvQtQR95CntJCbpJ9imA6um2g7gDTpv8JjChcVI0wPXLDj65JJvzE7b1eXA94sq3V Tt4dywA3j2xoYYJ7SMe5vOlqopnhxG+znPSMzEQfeT8E5ZDGR8lTbekC0ACmUAp8c049 lQyg== X-Gm-Message-State: AG10YORcGROac7uFTxwZehQiL2/Olg+l99P6Oo+TXjBUGC5nH44vvbT509/SEY0wwPtFJQ== X-Received: by 10.25.155.72 with SMTP id d69mr10857213lfe.134.1456284357335; Tue, 23 Feb 2016 19:25:57 -0800 (PST) Received: from [192.168.1.41] (ppp109-252-76-159.pppoe.spdop.ru. [109.252.76.159]) by smtp.gmail.com with ESMTPSA id f184sm105223lfe.6.2016.02.23.19.25.55 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Feb 2016 19:25:56 -0800 (PST) Subject: Re: [PATCH 10/14] dns: poll card between each dns request To: Josef Bacik , The development of GNU GRUB References: <1455139268-3241273-1-git-send-email-jbacik@fb.com> <1455139268-3241273-11-git-send-email-jbacik@fb.com> <56CCD707.5090505@fb.com> From: Andrei Borzenkov Message-ID: <56CD22C3.7060002@gmail.com> Date: Wed, 24 Feb 2016 06:25:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56CCD707.5090505@fb.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22f Cc: Kernel Team X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 03:26:04 -0000 24.02.2016 01:02, Josef Bacik пишет: > On 02/15/2016 01:45 AM, Andrei Borzenkov wrote: >> On Thu, Feb 11, 2016 at 12:21 AM, Josef Bacik wrote: >>> If we have dns servers that we prefer to get AAAA records from we'll >>> send a >>> packet and immediately check data.naddresses to see if we got a >>> response. If we >>> didn't we'll then send a request for an A record, and _then_ we'll >>> poll the >>> card. So if the DNS server doesn't respond between us sending the >>> packet and >>> checking data.naddresses we'll send a request for the A record and >>> then poll the >>> card. Instead we need to make sure we poll after we issue each >>> request to make >>> sure we give the server enough time to respond to our initial request. >>> >>> Signed-off-by: Josef Bacik >>> --- >>> grub-core/net/dns.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c >>> index 82a3307..86e609b 100644 >>> --- a/grub-core/net/dns.c >>> +++ b/grub-core/net/dns.c >>> @@ -587,12 +587,12 @@ grub_net_dns_lookup (const char *name, >>> grub_errno = GRUB_ERR_NONE; >>> err = err2; >>> } >>> + grub_net_poll_cards (200, &data.stop); >> >> One consideration is that it will increase timeouts in case of >> non-responsive servers, as now they are processed sequentially. >> >> But more importantly, this is still hit and miss - we rely on delivery >> order which is non-deterministic. We really need to ask for all and >> filter on receiving side. Two possible implementations are >> >> 1. Keep track of IPv4 and IPv6 answers separately; if non-preferred >> answer is received, continue to wait for preferred one until timeout. >> >> 2. Queries for both A and AAAA in the same packet and filter out answers. >> >> The 2 looks better. It avoids extra timeouts (at least if we assume >> that all DNS servers are equally authoritative) because as soon as we >> get any response we can stop polling. >> >> This will also indirectly fix another reported issue as we now can >> ignore any duplicate packet. >> >> Would you consider implementing it? > > Got this all implemented, started testing it and it just wasn't working, > come to find out our dns server (also bind) doesn't support more than > one question per packet. Oh! :( Sorry, I really did not expect it, given that multi-query was in DNS RFC from the very beginning. > So instead I'm going to keep track of which > type my DNS servers support and only do those questions. Updating the > cache is kind of a pain in the ass, I'll probably make it so we just > update in place the existing cache with the new answers. Thanks, > > Josef >