Description
The FunctionClauseError in GRPC.Client.Connection.handle_call/3 during disconnect — originally reported in #492 and #500 — was fixed for the 1.0.0-rc line in #493, but the fix has not been backported to the 0.11.x release line.
Users on 0.11.x (v0.11.2 – v0.11.5) still encounter this crash when calling GRPC.Stub.disconnect/1 because:
real_channels can contain {:error, reason} entries from build_real_channels/4 for failed connections, but the disconnect handler only pattern-matches {_key, {:ok, ch}}.
- For direct connections,
build_direct_state stores bare %GRPC.Channel{} structs instead of {:ok, channel} tuples.
Both cases cause the Enum.map anonymous function in the disconnect handler to raise a FunctionClauseError.
Expected behavior
GRPC.Stub.disconnect/1 should gracefully handle all channel states (ok, error, bare struct) without crashing the GRPC.Client.Connection process.
Related
Description
The
FunctionClauseErrorinGRPC.Client.Connection.handle_call/3during disconnect — originally reported in #492 and #500 — was fixed for the 1.0.0-rc line in #493, but the fix has not been backported to the 0.11.x release line.Users on
0.11.x(v0.11.2 – v0.11.5) still encounter this crash when callingGRPC.Stub.disconnect/1because:real_channelscan contain{:error, reason}entries frombuild_real_channels/4for failed connections, but the disconnect handler only pattern-matches{_key, {:ok, ch}}.build_direct_statestores bare%GRPC.Channel{}structs instead of{:ok, channel}tuples.Both cases cause the
Enum.mapanonymous function in the disconnect handler to raise aFunctionClauseError.Expected behavior
GRPC.Stub.disconnect/1should gracefully handle all channel states (ok, error, bare struct) without crashing theGRPC.Client.Connectionprocess.Related