From 1be78a962d36cd2a677bd1af543a44f527183f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 24 Apr 2024 17:29:30 +0200 Subject: [PATCH] Fix goroutine leak and close Computation.Event computation finishes (#15) --- CHANGELOG.md | 5 +++++ signalflow/computation.go | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d23cfa3..95efa9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,3 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased + +### Fixed + +- Fix a goroutine leak and close the channel returned by `Computation.Events` when the computation finishes. + [(#15)](https://github.com/signalfx/signalflow-client-go/pull/15) diff --git a/signalflow/computation.go b/signalflow/computation.go index fa24014..ce1ad0d 100644 --- a/signalflow/computation.go +++ b/signalflow/computation.go @@ -342,6 +342,7 @@ func (c *Computation) shutdown() { close(c.dataChBuffer) close(c.expirationChBuffer) close(c.infoChBuffer) + close(c.eventChBuffer) } var ErrMetadataTimeout = errors.New("metadata value did not come in time")