open-feature/flagd

[BUG] `flagd-proxy` does not shut down if a streaming client is connected

Closed this issue · 0 comments

Observed behavior

flagd-proxy hangs when it gets a SIGINT if a streaming client is listening. It hangs with this message:

info    cmd/start.go:84 Shutting down server...

Expected Behavior

flagd-proxy shuts down within a reasonable timeframe no matter if clients are connected.

Steps to reproduce

This can be reproduced simply by pulling and setting-up the flagd repo (the following steps assume you've done this):

go run flagd-proxy/main.go start

Use grpcurl to setup a stream (you will have to download grpcurl and create a proto/ dir containing sync.proto in your working directory.

grpcurl -d '{"selector":"file:{YOUR_FLAGD_REPO_LOCATION}/config/samples/example_flags.json"}' -import-path proto/ -proto sync.proto -plaintext localhost:8015 flagd.sync.v1.FlagSyncService/SyncFlags

# if you see no error, now we are connected

Now send a SIGINT to flagd-proxy with ctrl+c and observe the shutdown hangs