Commit Graph

17 Commits

Author SHA1 Message Date
Sridhar Ratnakumar 976fc15b81 update change log, gofmt and remove debug prints 2013-05-28 14:01:32 -07:00
Sridhar Ratnakumar 644891ebbc BlockUntilExists should return immediately if the file already exists
this fixes a potential race condition in the use of BlockUntilExists
following a file existence check (as we do in tail.go:reopen).

closes issue 5
2013-05-28 13:29:40 -07:00
Sridhar Ratnakumar c90cd7b8db add truncation detection to PollingFileWatcher 2013-05-28 12:54:53 -07:00
Sridhar Ratnakumar 5ccafcc3d6 fixes on top of Florian's truncation detection (1ff299bc2)
* initialize `Size` with the then-size of the file when ChangeEvents
  is called. remember that this function is expected to be called many
  times, one after another. this also passes the TestReSeekInotify
  test.

* do not ignore errors from os.Stat. we panic errors like these now,
  but ideally should switch to tomb.Tomb for letting the user handle
  them.
2013-05-28 12:31:46 -07:00
Florian Weingarten 1ff299bc29 Add support for file truncation in InotifyFileWatcher
(cherry picked from commit 9de77aad8caca8102e7dd7c936d00ca3f0421ca7)
2013-05-28 11:59:03 -07:00
Sridhar Ratnakumar 39e5784aed allow compilation on Go1 2013-05-28 10:52:38 -07:00
Sridhar Ratnakumar 1336a0e4ab remove a redundant goroutine 2013-05-27 15:41:33 -07:00
Sridhar Ratnakumar ec461b87f0 implement PollingFileWatcher.BlockUntilExists 2013-05-27 15:34:50 -07:00
Sridhar Ratnakumar c5073c7f26 PollingFileWatcher.ChangeEvents must detect file deletion/rename 2013-05-27 15:34:50 -07:00
Sridhar Ratnakumar bf1dd37666 fix comments for godoc 2013-03-10 15:17:00 -07:00
Sridhar Ratnakumar 0449e85ca5 add license and copyright 2013-01-07 12:54:49 -08:00
Sridhar Ratnakumar df3f97310f test: fixture workflow to make test functions concise 2012-10-13 11:44:47 -07:00
Sridhar Ratnakumar dfe0ea8ba5 optimize polling watcher using stat check
does not send 'changed' events if the last modified time hasn't changed.
2012-10-12 18:12:49 -07:00
Sridhar Ratnakumar adcb2e389d fix: BlockUntilExists should only return if filename matches 2012-10-12 17:30:45 -07:00
Sridhar Ratnakumar 048bbf8933 introduce tail command; fix tomb blocking after Kill 2012-10-12 17:14:35 -07:00
Sridhar Ratnakumar 74f84016b8 close the inotify watcher when returning
might fix http://bugs.activestate.com/show_bug.cgi?id=95803#c12
2012-10-12 07:09:36 -07:00
Sridhar Ratnakumar 3ff602e781 Bug #95803 - reduce cpu usage due to frequent polling
* use inotify for system log aggregation
* continue using polling for app log aggregation (overlayfs bug)
  * but increase wait time to 250ms

Squashed commit of the following:

commit 8ccd0359e559472be0066ad889ac1772e13ff20b
Author: Sridhar Ratnakumar <sridharr@activestate.com>
Date:   Thu Oct 11 21:28:41 2012 -0700

    complete the polling watcher

commit 0a5d5aa488e96aa247c7c88c25cd5a30219f5344
Author: Sridhar Ratnakumar <sridharr@activestate.com>
Date:   Thu Oct 11 20:50:08 2012 -0700

    hackish, untested, incomplete implementation of pollig filewatcher

    .. to be tested on macbook.

commit c7ac3851452ed23a8b099773cc9c9f23734a89f5
Author: Sridhar Ratnakumar <sridharr@activestate.com>
Date:   Thu Oct 11 15:45:59 2012 -0700

    tail: use inotify instead of polling

    reduces cpu usage and fixes  Bug #95803
2012-10-11 21:29:35 -07:00