Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkg/acquisition/modules/syslog/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ func (s *Source) Stream(ctx context.Context, out chan pipeline.Event) error {
})

g.Go(func() error {
defer close(out)

for {
select {
case <-ctx.Done():
Expand Down
7 changes: 7 additions & 0 deletions pkg/acquisition/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ type Fetcher interface {
// failures, but treat them as errors. The caller is responsible for supervising
// Stream(), and restarting it as needed. There is currently no way to differentiate
// retryable vs permanent errors.
// - never close the output channel: it is shared and fed by every configured
// datasource, so it is owned by the acquisition orchestrator, not by any single
// Stream() implementation. Closing it here would race with (and can panic) any
// other datasource still sending on it.
type RestartableStreamer interface {
// Start live acquisition (eg, tail a file)
Stream(ctx context.Context, out chan pipeline.Event) error
Expand All @@ -84,6 +88,9 @@ type RestartableStreamer interface {
// Tailer has the same pupose as RestartableStreamer (provide ongoing events) but
// is responsible for spawning its own goroutines, and handling errors and retries.
// New datasources are expected to implement RestartableStreamer instead.
//
// As with RestartableStreamer, the output channel is shared and orchestrator-owned:
// an implementation must never close it.
type Tailer interface {
StreamingAcquisition(ctx context.Context, out chan pipeline.Event, acquisTomb *tomb.Tomb) error
}
Expand Down
Loading