From owner-p4-projects@FreeBSD.ORG Tue Jul 31 17:52:02 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 402E516A47B; Tue, 31 Jul 2007 17:52:02 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2D9716A46B; Tue, 31 Jul 2007 17:52:01 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id 39E4713C461; Tue, 31 Jul 2007 17:52:01 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id BE16A487F0; Tue, 31 Jul 2007 19:51:58 +0200 (CEST) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 4CFF345B26; Tue, 31 Jul 2007 19:51:53 +0200 (CEST) Date: Tue, 31 Jul 2007 19:51:05 +0200 From: Pawel Jakub Dawidek To: Ulf Lilleengen Message-ID: <20070731175105.GU1092@garage.freebsd.pl> References: <200707301047.l6UAlD8L092463@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="f0Ums9VvOMUG7syy" Content-Disposition: inline In-Reply-To: <200707301047.l6UAlD8L092463@repoman.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: Perforce Change Reviews Subject: Re: PERFORCE change 124344 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2007 17:52:02 -0000 --f0Ums9VvOMUG7syy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 30, 2007 at 10:47:13AM +0000, Ulf Lilleengen wrote: > http://perforce.freebsd.org/chv.cgi?CH=3D124344 >=20 > Change 124344 by lulf@lulf_carrot on 2007/07/30 10:47:07 >=20 > - Sleep after sending create requests in userland, since the event might > not yet be processed. If there are noteable issues with this, which is > a quite unlikely to happen, I have a patch to support suspending > of the userland process until the events are executed, but it's only > required in this special case. Sleeping that way is, as you noted, not very nice... Can't you put a loop below errstr check, which will wait for drive creation. You could sleep for eg. 0.1s between checks. Also not very nice, but even 2s may be too low on very loaded systems. > Affected files ... >=20 > .. //depot/projects/soc2007/lulf/gvinum_fixup/sbin/gvinum/gvinum.c#15 edit >=20 > Differences ... >=20 > =3D=3D=3D=3D //depot/projects/soc2007/lulf/gvinum_fixup/sbin/gvinum/gvinu= m.c#15 (text+ko) =3D=3D=3D=3D >=20 > @@ -430,6 +430,8 @@ > gctl_ro_param(req, "plexes", sizeof(int), &plexes); > gctl_ro_param(req, "subdisks", sizeof(int), &subdisks); > errstr =3D gctl_issue(req); > + sleep(2); /* Wait for events to be executed. XXX: not very nice... but= =20 > + we won't have to modify event system for just his issue. */ > if (errstr !=3D NULL) > warnx("error creating drive: %s", errstr); > gctl_free(req); --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --f0Ums9VvOMUG7syy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGr3aJForvXbEpPzQRAt4eAKCu+BQmiU9H2D9wEmWjF4k8NUZaMgCfS1UV 0e9SmM5v60lK+5J9wS+2YGk= =N1Xm -----END PGP SIGNATURE----- --f0Ums9VvOMUG7syy--