open-feature / go-sdk

Go SDK for OpenFeature
https://openfeature.dev
Apache License 2.0
138 stars 33 forks source link

fix: wait for concurrent operations to finish in initNewAndShutdownOld #239

Closed i-fix-retarded-bugs closed 10 months ago

i-fix-retarded-bugs commented 10 months ago

This PR

Related Issues

Fixes #238

How to test

Check that the panicking code listed in the issue no longer panics. It does not.

toddbaert commented 10 months ago

Hey @i-fix-retarded-bugs , please see my comment here.

We definitely have some doc shortcomings here, and we certainly wouldn't expect any panics, so there may be a bug somewhere here. Additionally, we would expect the usage of a READY handler here to make sure the provider has initialized (that's the shortcoming in our tutorial).

However, we can't make this function sync. We could add a new function that behaves this way though (we have something similar in other SDKs). If you'd like to implement that, we'd accept that change (pending that you update all references to your username as mentioned).

toddbaert commented 10 months ago

Indeed, the panic here is the result of a bug in the flagd provider. I've opened an issue for that: https://github.com/open-feature/go-sdk-contrib/issues/407.

Here is an issue to create a blocking version of this method, which you are free to help with if you're interested: https://github.com/open-feature/go-sdk/issues/240

toddbaert commented 10 months ago

Closing. See https://github.com/open-feature/go-sdk/issues/238#issuecomment-1854409704 and linked issues.