From owner-freebsd-current Wed Apr 26 14:14:11 2000 Delivered-To: freebsd-current@freebsd.org Received: from nagual.pp.ru (hermes.dialup.ru [194.87.16.230]) by hub.freebsd.org (Postfix) with ESMTP id DE65A37BD32 for ; Wed, 26 Apr 2000 14:14:06 -0700 (PDT) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.9.3/8.9.3) id BAA07544 for current@freebsd.org; Thu, 27 Apr 2000 01:14:04 +0400 (MSD) (envelope-from ache) Date: Thu, 27 Apr 2000 01:14:02 +0400 From: "Andrey A. Chernov" To: current@freebsd.org Subject: Workaround for hanging on exit: patch for review Message-ID: <20000427011402.A7265@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.1i Organization: Biomechanoid Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I often notice processes hanging forever on exit's ttywait when TCP connection dropped. Here is a patch I plan to commit which restrict waiting for output drain by 3 minutes. Any comments, improvements or objections? --- kern_exit.c.bak Sun Apr 16 23:35:55 2000 +++ kern_exit.c Thu Apr 27 00:56:02 2000 @@ -230,6 +230,9 @@ if (sp->s_ttyp && (sp->s_ttyp->t_session == sp)) { if (sp->s_ttyp->t_pgrp) pgsignal(sp->s_ttyp->t_pgrp, SIGHUP, 1); + /* XXX don't hang forever */ + if (sp->s_ttyp->t_timeout == 0) + sp->s_ttyp->t_timeout = 180 * hz; (void) ttywait(sp->s_ttyp); /* * The tty could have been revoked -- Andrey A. Chernov http://nagual.pp.ru/~ache/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message