Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Tailers Issue? #8

Closed
araddon opened this issue Jun 25, 2013 · 4 comments
Closed

Multiple Tailers Issue? #8

araddon opened this issue Jun 25, 2013 · 4 comments

Comments

@araddon
Copy link

araddon commented Jun 25, 2013

I have been trying to tail multiple files, and not getting responses on 2nd (...n) files. Unit test here, possibly im doing something else wrong, and poked around trying to fix underlying issue but didn't immediately come to me so thought I would drop this test in case anyone else sees it.

https://github.com/araddon/tail/compare/multi_tail?expand=1

@srid
Copy link
Contributor

srid commented Jun 25, 2013

multiple tail sessions should work of course as we do exactly the same in our own product. i checked out your branch multi_tail and ran go test which passes without any issue.

@srid
Copy link
Contributor

srid commented Jun 25, 2013

multiple tail sessions should work of course as we do exactly the same in our own product.

snipped from our internal code:

    tailers := []*tail.Tail{}
    [...]
    for name, logfile := range logFiles {
        t, err := tail.TailFile(logfile, tail.Config{
            Follow:      true,
            ReOpen:   true})
        if err != nil {
            log.Fatal(err)
        }
        tailers = append(tailers, t)
    }
    for _, tail := range tailers {
        err := tail.Wait()
        if err != nil {
            log.Errorf("Cannot tail [%s]: %s", tail.Filename, err)
        }
    }

The Lines channel will be read by separate goroutines.

@araddon
Copy link
Author

araddon commented Jun 25, 2013

Thanks for the info and trying it, let me try some more investigation, im running it on Ubuntu13.04 x64 (Inotify) and getting failure on that MultiAppend test (tried on laptop + desktop)::

$ go test -run Multi
--- FAIL: TestMultiTailAppend (0.15 seconds)
tail_test.go:316: tail ended early; expecting more: [more data]
FAIL
exit status 1
FAIL    github.com/ActiveState/tail 0.157s

@araddon
Copy link
Author

araddon commented Jun 25, 2013

Upon investigation, this turned out to be unrleated, I found the issue #9

@araddon araddon closed this as completed Jun 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants