diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-11-06 22:10:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-06 22:10:11 +0100 |
commit | 2e2d82ce767895e80da0d6cf5e6d391901687deb (patch) | |
tree | 71a182d5ed5181c3679e63600cea6b017e1d359a /libpod/events/journal_linux.go | |
parent | 581a7ec2984c2c125ff255c9aca62f2547c7d46f (diff) | |
parent | 276d68c8f54ef1b268eb5a4f5d8c35822eb77f2b (diff) | |
download | podman-2e2d82ce767895e80da0d6cf5e6d391901687deb.tar.gz podman-2e2d82ce767895e80da0d6cf5e6d391901687deb.tar.bz2 podman-2e2d82ce767895e80da0d6cf5e6d391901687deb.zip |
Merge pull request #4461 from giuseppe/fix-hang
events: make sure the write channel is always closed
Diffstat (limited to 'libpod/events/journal_linux.go')
-rw-r--r-- | libpod/events/journal_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/events/journal_linux.go b/libpod/events/journal_linux.go index 470c76959..9e6fffc29 100644 --- a/libpod/events/journal_linux.go +++ b/libpod/events/journal_linux.go @@ -54,6 +54,7 @@ func (e EventJournalD) Write(ee Event) error { // Read reads events from the journal and sends qualified events to the event channel func (e EventJournalD) Read(options ReadOptions) error { + defer close(options.EventChannel) eventOptions, err := generateEventOptions(options.Filters, options.Since, options.Until) if err != nil { return errors.Wrapf(err, "failed to generate event options") @@ -87,7 +88,6 @@ func (e EventJournalD) Read(options ReadOptions) error { if err != nil { return err } - defer close(options.EventChannel) for { if _, err := j.Next(); err != nil { return err |