Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Sink Close() method is never called #10

Closed
mdemierre opened this issue Dec 15, 2019 · 0 comments
Closed

Sink Close() method is never called #10

mdemierre opened this issue Dec 15, 2019 · 0 comments

Comments

@mdemierre
Copy link
Contributor

Whie implementing a new sink, I noticed that my Close() method was never called.

I expected it to be called when sending SIGTERM to the process, and that it would be waited for before terminating.

mdemierre added a commit to mdemierre/kubernetes-event-exporter that referenced this issue Dec 15, 2019
Before the change, the engine didn't call the `Close()` method of the
sinks. This is needed in some cases, i.e when a sink implementation is
buffered.

This change adds a `Close()` method to the registry that
will signal sinks to exit and wait for all sinks to exit before
returning. In the channel-based registry, the closing of all sinks is
done in parallel (using a `sync.WaitGroup`). In the sync registry, sinks
are closed one after the other.

Fixes issue opsgenie#10
mdemierre added a commit to mdemierre/kubernetes-event-exporter that referenced this issue Dec 15, 2019
Before the change, the engine didn't call the `Close()` method of the
sinks. This is needed in some cases, i.e when a sink implementation is
buffered.

This change adds a `Close()` method to the registry that
will signal sinks to exit and wait for all sinks to exit before
returning. This is then used in the engine stop logic.

In the channel-based registry, the closing of all sinks is done in
parallel (using a `sync.WaitGroup`). In the sync registry, sinks are
closed sequentially.

Fixes issue opsgenie#10
mdemierre added a commit to mdemierre/kubernetes-event-exporter that referenced this issue Dec 15, 2019
Before the change, the engine didn't call the `Close()` method of the
sinks. This is needed in some cases, i.e when a sink implementation is
buffered.

This change adds a `Close()` method to the registry that
will signal sinks to exit and wait for all sinks to exit before
returning. This is then used in the engine stop logic.

In the channel-based registry, the closing of all sinks is done in
parallel (using a `sync.WaitGroup`). In the sync registry, sinks are
closed sequentially.

Fixes issue opsgenie#10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants