NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/56713 - tail -f doesn't follow (fwd)



The following reply was made to PR kern/56713; it has been noted by GNATS.

From: Paul Goyette <paul%whooppee.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56713 - tail -f doesn't follow (fwd)
Date: Sun, 6 Mar 2022 09:46:16 -0800 (PST)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 
 --0-926920624-1646417808=:9907
 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed
 Content-ID: <Pine.NEB.4.64.2203060945152.13724%speedy.whooppee.com@localhost>
 
 Logging to PR ...
 
 ---------- Forwarded message ----------
 Date: Fri, 4 Mar 2022 10:16:48 -0800 (PST)
 From: Paul Goyette <paul%whooppee.com@localhost>
 To: thorpej%netbsd.org@localhost
 Cc: martin%netbsd.org@localhost
 Subject: Re: kern/56713 - tail -f doesn't follow
 
 Jason,
 
 I tried to reproduce this in a simple test program (see attached,
 especially see the coment at the top!).  Unfortunately, it doesn't
 seem to trigger.  I used ktraace to ensure that the file-extend
 happens between the creation of the eventlist and the wait-for-
 event calls, so it should certainly trigger on the "pre-existing
 event" guess from before.  But no, it doesn't trigger.
 
 I noticed that tail(1) does a whole lot more than just calling
 kevent().  It appears to read from the file several times, and
 also does an fstat and ioctl (which I did not decode).  So maybe
 the problem is really inside tail(1) itself and not inside the
 kernel.
 
 I saw on irc last night that mlelstv@ was able to easily repro
 the problem using the null-mount, so perhaps that's important?
 
 Thanks in advance for your help.
 
 
 On Wed, 2 Mar 2022, Paul Goyette wrote:
 
 > This is happening more and more frequently - today it is happening on
 > every attempt to tail a log file that is still being written to.
 > 
 > It "feels" like the kevent stuff isn't triggering on pre-existing
 > events.
 > 
 > I'm happy to help debug...
 > 
 > Not sure but this feels like basic-functionality-regression which
 > maybe ought to block the release.
 > 
 > 
 > +--------------------+--------------------------+----------------------+
 > | Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:    |
 > | (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost    |
 > | Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette%netbsd.org@localhost  |
 > | & Network Engineer |                          | pgoyette99%gmail.com@localhost |
 > +--------------------+--------------------------+----------------------+
 >
 
 +--------------------+--------------------------+----------------------+
 | Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:    |
 | (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul%whooppee.com@localhost    |
 | Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette%netbsd.org@localhost  |
 | & Network Engineer |                          | pgoyette99%gmail.com@localhost |
 +--------------------+--------------------------+----------------------+
 --0-926920624-1646417808=:9907
 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=TAIL.c
 Content-Transfer-Encoding: BASE64
 Content-ID: <Pine.NEB.4.64.2203041016480.9907%speedy.whooppee.com@localhost>
 Content-Description: 
 Content-Disposition: ATTACHMENT; FILENAME=TAIL.c
 
 I2luY2x1ZGUgPGVyci5oPg0KI2luY2x1ZGUgPGZjbnRsLmg+DQojaW5jbHVk
 ZSA8c3RkbGliLmg+DQojaW5jbHVkZSA8dW5pc3RkLmg+DQoNCiNpbmNsdWRl
 IDxzeXMvZXZlbnQuaD4NCiNpbmNsdWRlIDxzeXMvdGltZS5oPg0KDQovKg0K
 ICogRXh0ZXJuYWwgc2V0LXVwIGNvZGUgaXMgZXhwZWN0ZWQgdG8gZG8gdGhl
 IGVxdWl2YWxlbnQgb2YNCiAqCWNkICRUT1BESVINCiAqCW1rZGlyIHJlYWxk
 aXINCiAqCW1rZGlyIG51bGxkaXINCiAqCW1vdW50IC10IG51bGwgJFRPUERJ
 Ui9udWxsZGlyICRUT1BESVIvcmVhbGRpcg0KICoJcm0gLWYgJFRPUERJUi9y
 ZWFsZGlyL3RoZWZpbGUNCiAqCXRvdWNoICRUT1BESVIvcmVhbGRp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