From f91dd5c53310e646b0e7cec4a3c1c2a2a7f76ac0 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Mon, 25 Nov 2024 15:00:36 -0500 Subject: [PATCH] fixup: recreate channel on any grpc err Signed-off-by: Todd Baert --- .../provider/flagd/resolvers/process/connector/grpc_watcher.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py index 8d92521a..650fc95d 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py @@ -111,8 +111,7 @@ def sync_flags(self) -> None: except grpc.RpcError as e: logger.error(f"SyncFlags stream error, {e.code()=} {e.details()=}") # re-create the stub if there's a connection issue - otherwise reconnect does not work as expected - if e.code() == grpc.StatusCode.UNAVAILABLE: - self.stub, self.channel = self.create_stub() + self.stub, self.channel = self.create_stub() except json.JSONDecodeError: logger.exception( f"Could not parse JSON flag data from SyncFlags endpoint: {flag_str=}"