From owner-freebsd-net@freebsd.org Wed Jan 18 04:37:43 2017 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13128CB543A for ; Wed, 18 Jan 2017 04:37:43 +0000 (UTC) (envelope-from 01000159afddb4bb-d78bc275-7ce9-41da-93bd-0a7445a74fa0-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDFE2106D for ; Wed, 18 Jan 2017 04:37:42 +0000 (UTC) (envelope-from 01000159afddb4bb-d78bc275-7ce9-41da-93bd-0a7445a74fa0-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1484714259; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=s9qVqxHiSOPQtViKAeAAyS3J6vqATnmbVkY2D93jRk8=; b=oYXklsHUOWTbJxn+XwWMwfBjDSy1cDe+xXPVvu95/laxf7vfm5Z438J+1Np5BaaX +Hgv/ZRvgQqUQGpCTaWTxbVuggq1ccY3sSJHW0Wyn/Pw4aiQfTGBOER/dWcpg7kH9i+ VonbOsVB4D9X3IemSxZonQzqC+nmn878VYxNzSMI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1484714259; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=s9qVqxHiSOPQtViKAeAAyS3J6vqATnmbVkY2D93jRk8=; b=0GPEbKsv6YN1Xnca4xw1tzKP79CHiTdL1r+B54p3MER38W7o7c4o8KimES2cLjng tWC8oAk7u4i47GoUbVWJePd2fskiStGXPGKCSaBExc5qJSGVOfM4DkZHTrQy6ifrVwF pgXWfTQn3IEhZhbaqCoXEiCSiOfdf8Z7P5gPYsa4= Subject: Re: sosend returning ERESTART To: Konstantin Belousov References: <01000159aac969e6-b2fc3913-d04e-42d4-befd-402ed0d830bf-000000@email.amazonses.com> <20170117100634.GS2349@kib.kiev.ua> Cc: freebsd-net@freebsd.org From: Colin Percival Message-ID: <01000159afddb4bb-d78bc275-7ce9-41da-93bd-0a7445a74fa0-000000@email.amazonses.com> Date: Wed, 18 Jan 2017 04:37:39 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170117100634.GS2349@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2017.01.18-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 04:37:43 -0000 On 01/17/17 02:06, Konstantin Belousov wrote: > On Tue, Jan 17, 2017 at 04:57:23AM +0000, Colin Percival wrote: >> I think I've tracked an NFS problem down to sosend returning ERESTART; it >> looks like it's easy to work around this, but I'm not sure *why* sosend is >> returning ERESTART... or for that matter *how* since I can't find anywhere >> in relevant code where that gets returned. > ERESTART is most likely returned by msleep(9) or similar call down the > path when unblocked signal is pending with the restart disposition. Thanks, looks like that was exactly it -- if the TCP send buffer was full we would call sbwait, and if a signal arrived it would return ERESTART. It looks like setting the SB_NOINTR flag will prevent this; I'm testing a patch right now. (Google bait in case anyone else trips over this: FreeBSD 11.0 NFS client dropping TCP connections under concurrent I/O load.) -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid