From 4f1905a9ac6d62b5edb297fba904aac8680c89cf Mon Sep 17 00:00:00 2001 From: James Milligan <75740990+james-milligan@users.noreply.github.com> Date: Wed, 1 Feb 2023 19:01:56 +0000 Subject: [PATCH] fix: fix unbuffered channel blocking goroutine (#358) Signed-off-by: James Milligan ## This PR - buffers channel on startup to prevent blocking in linked issue ### Related Issues https://github.com/open-feature/flagd/issues/356 ### Notes ### Follow-up Tasks ### How to test Signed-off-by: James Milligan --- pkg/runtime/runtime.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/runtime/runtime.go b/pkg/runtime/runtime.go index 41b468c68..3c441a0ee 100644 --- a/pkg/runtime/runtime.go +++ b/pkg/runtime/runtime.go @@ -55,7 +55,7 @@ func (r *Runtime) Start() error { defer cancel() g, gCtx := errgroup.WithContext(ctx) - dataSync := make(chan sync.DataSync) + dataSync := make(chan sync.DataSync, len(r.SyncImpl)) // Initialize DataSync channel watcher g.Go(func() error {