Re: [PATCH] tail: fix a race condition

2009-10-22 Thread Jim Meyering
Giuseppe Scrivano wrote: ... Subject: [PATCH] tests: add a new test that checks for a possible `tail' race. If new data is available between the initial read and tail registers the inotify watch descriptors, ensure that it is read before a new event happens on the file. *

Re: [PATCH] tail: fix a race condition

2009-10-22 Thread Jim Meyering
Jim Meyering wrote: Giuseppe Scrivano wrote: ... Subject: [PATCH] tests: add a new test that checks for a possible `tail' race. If new data is available between the initial read and tail registers the inotify watch descriptors, ensure that it is read before a new event happens on the

Re: [PATCH] tail: fix a race condition

2009-10-20 Thread Giuseppe Scrivano
Hello, I wrote a simple test case, taking some ideas from the old commit 11b626c20fbc65c668081996bfb9d1118f475eda. The test has a race (it is funny, considering that it checks for a race) and I used quite long time periods to minimize it, probably under high loads it can cause a false positive.

Re: [PATCH] tail: fix a race condition

2009-10-20 Thread Pádraig Brady
Giuseppe Scrivano wrote: Hello, I wrote a simple test case, taking some ideas from the old commit 11b626c20fbc65c668081996bfb9d1118f475eda. The test has a race (it is funny, considering that it checks for a race) and I used quite long time periods to minimize it, probably under high

Re: [PATCH] tail: fix a race condition

2009-10-20 Thread Jim Meyering
Giuseppe Scrivano wrote: I wrote a simple test case, taking some ideas from the old commit 11b626c20fbc65c668081996bfb9d1118f475eda. The test has a race (it is funny, considering that it checks for a race) and I used quite long time periods to minimize it, probably under high loads it can

Re: [PATCH] tail: fix a race condition

2009-10-20 Thread Giuseppe Scrivano
Hi Jim, Jim Meyering j...@meyering.net writes: Thanks for doing that. A couple suggestions: Thanks for the suggestions! I am using a 1.5 seconds time interval before kill the debugged process, I hope it is enough when there are many parallel tests. Giuseppe From

Re: [PATCH] tail: fix a race condition

2009-10-20 Thread Jim Meyering
Giuseppe Scrivano wrote: +++ b/tests/tail-2/inotify-race Thanks. With something like the following it should be good. @@ -0,0 +1,72 @@ +#!/bin/sh +# Copyright (C) 2006, 2009 Free Software Foundation, Inc. It's customary to say what the test does. # Ensure that tail does not ignore data

Re: [PATCH] tail: fix a race condition

2009-10-20 Thread Giuseppe Scrivano
Jim Meyering j...@meyering.net writes: Thanks again for your notes. I amended them into the patch. Cheers, Giuseppe From 3f0f5744899afc15e69554220be836f673b1dad3 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano gscriv...@gnu.org Date: Tue, 20 Oct 2009 10:49:17 +0200 Subject: [PATCH] tests:

Re: [PATCH] tail: fix a race condition

2009-10-13 Thread Jim Meyering
. ... Subject: [PATCH] tail: fix a race condition * NEWS (Bug fixes): Mention it. * src/tail.c (check_fspec): New function. (tail_forever_inotify): Ensure there is no new data before entering the inotify events wait loop. Hi Giuseppe, Thank you! I haven't reviewed this yet, but will do so today

Re: [PATCH] tail: fix a race condition

2009-10-13 Thread Giuseppe Scrivano
Hi Jim, Jim Meyering j...@meyering.net writes: I haven't reviewed this yet, but will do so today or tomorrow. I know triggering race conditions can be hard, but can you write a script that demonstrates the failure? This might be a good excuse to experiment with the now-usable-as-non-root