From owner-freebsd-hackers@FreeBSD.ORG  Tue Jun 24 07:23:21 2008
Return-Path: <owner-freebsd-hackers@FreeBSD.ORG>
Delivered-To: freebsd-hackers@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 929E01065677
	for <freebsd-hackers@freebsd.org>; Tue, 24 Jun 2008 07:23:21 +0000 (UTC)
	(envelope-from kamikaze@bsdforen.de)
Received: from mail.bsdforen.de (bsdforen.de [212.204.60.79])
	by mx1.freebsd.org (Postfix) with ESMTP id 464648FC0C
	for <freebsd-hackers@freebsd.org>; Tue, 24 Jun 2008 07:23:21 +0000 (UTC)
	(envelope-from kamikaze@bsdforen.de)
Received: from mobileKamikaze.norad (unknown [92.116.44.7])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.bsdforen.de (Postfix) with ESMTP id 6E3F08A0EF4;
	Tue, 24 Jun 2008 09:23:14 +0200 (CEST)
Message-ID: <4860A0DB.8000100@bsdforen.de>
Date: Tue, 24 Jun 2008 09:23:07 +0200
From: Dominic Fandrey <kamikaze@bsdforen.de>
User-Agent: Thunderbird 2.0.0.14 (X11/20080607)
MIME-Version: 1.0
To: Kostik Belousov <kostikbel@gmail.com>
References: <485EAE11.2050808@bsdforen.de>	<200806221615.50498.amistry@am-productions.biz>	<485F4593.9050807@bsdforen.de>	<5f67a8c40806231141vf7b9567mdf75e81f32169211@mail.gmail.com>
	<20080623192622.GD17123@deviant.kiev.zoral.com.ua>
In-Reply-To: <20080623192622.GD17123@deviant.kiev.zoral.com.ua>
X-Enigmail-Version: 0.95.6
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: freebsd-hackers@freebsd.org, Zaphod Beeblebrox <zbeeble@gmail.com>
Subject: Re: FreeBSD fusefs-kmod shutdown problem workaround
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
	<freebsd-hackers.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, 
	<mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>,
	<mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Jun 2008 07:23:21 -0000

Kostik Belousov wrote:
> On Mon, Jun 23, 2008 at 02:41:29PM -0400, Zaphod Beeblebrox wrote:
>> On Mon, Jun 23, 2008 at 2:41 AM, Dominic Fandrey <kamikaze@bsdforen.de>
>> wrote:
>>
>>
>>> Thanks for the pointer. Unfortunately it seems that Csaba's patch only
>>> allows you to stall shutdown for 10 seconds. After heavy writing
>>> more than a minute can be necessary to prevent data loss.
>>>
>>> I have created a problem report: ports/124901
>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=124901
>>>
>>> I hope this will make it. To me data loss and file system corruption
>>> are the worst case scenario and to me it's worth stalling shutdown
>>> for as long as it takes to write the data.
>>>
>> The shutdown watchdog timer is something I've had to adjust many times for
>> many different ports. Given this;
>>
>> I propose we have (at least) a new rcorder script variable.  Something like
>> "SHUTTIME" encoding the expected number of seconds required for the daemon
>> to shutdown in the worst case.
>>
>> Ideally, you'd want an overall watchdog and a per-script watchdog (so that
>> you're not waiting the sum of all these times in most cases).
> 
> We already have rcshutdown_timeout, see the rc.conf(5) and description
> of the sysctl kern.init_shutdown_timeout.

He knows that. He just wants something more fine-grained. And
rcshutdown_timeout has to be set by the user.

Following Zaphod's suggestion I'd like to have a more generous watchdog default
(maybe 3 minutes) and a per script watchdog that defaults to something around
30 seconds, but can be changed in the rc script.

I'll give that a try tonight.