Backport: fix FunctionClauseError in disconnect handler (0.11.x)#533
Open
saner wants to merge 37 commits intoelixir-grpc:release/v0.11.3from
Open
Backport: fix FunctionClauseError in disconnect handler (0.11.x)#533saner wants to merge 37 commits intoelixir-grpc:release/v0.11.3from
saner wants to merge 37 commits intoelixir-grpc:release/v0.11.3from
Conversation
….run (elixir-grpc#453) * fix: GRPC.Stream.run only consumes the first reply and returns :ok * fix: simplify noreply workflow
Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
* chore: release new version * bump 0.10.2 -> 0.11.0 * refactor: better extract_subtype invalid type message and change log level * chore: use warning log level --------- Co-authored-by: Adriano Santos <adriano.santos@v3.com.br>
* fix: refresh error spam on direct_state (no lb) * chore: formatting connection module --------- Co-authored-by: joeri dijkstra <joeri.dijkstra@bettyblocks.com>
* chore: release new version * bump 0.10.2 -> 0.11.0 * feat: added new function to handle side-effects * chore: added doc, remove comments * feat: added error handler unary and stream pipelines * test: added many more tests * Update lib/grpc/stream.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update lib/grpc/stream.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * fix: correct return type in doc * Update lib/grpc/stream/operators.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * chore: updated after review * docs: adds a better explanation of the different types of input * mix format * test: reintroduces tests that were removed by mistake * docs: introduces documentation for error handling and side effects * Update README.md Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update README.md Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update lib/grpc/stream.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update test/grpc/integration/server_test.exs Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update test/grpc/stream_test.exs Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update test/grpc/stream_test.exs Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * chore: resolve review comments * chore: remove markdown clutter --------- Co-authored-by: Adriano Santos <adriano.santos@v3.com.br> Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
* chore: release new version * bump 0.10.2 -> 0.11.0 * docs: try more professional documentation * formatting * temporary remove warning as errors * chore: remove deprecated annotation * Update guides/getting_started/client.md Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update guides/getting_started/installation.md Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update guides/getting_started/installation.md Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update guides/getting_started/installation.md Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update guides/getting_started/introduction.md Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * chore: adjustments after review * chore: added header * Update lib/grpc/server.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update lib/grpc/stream.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update lib/grpc/stream.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * doc: added flush function * doc: rename :utility to :actions * docs: update and adjustments * chore: remove subproject examples --------- Co-authored-by: Adriano Santos <adriano.santos@v3.com.br> Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
* chore: release new version * bump 0.10.2 -> 0.11.0 * fix: correct struct syntax --------- Co-authored-by: Adriano Santos <adriano.santos@v3.com.br>
* chore: release new version * bump 0.10.2 -> 0.11.0 * fix: correct struct syntax * bump v0.11.3 -> v0.11.4 --------- Co-authored-by: Adriano Santos <adriano.santos@v3.com.br>
* Add `exception_log_filter` option to server * Only allow MF form * refactor: more flexible filtering * chore: format * test: improve test * chore: format * fix test --------- Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
* Ensure 1 GRPC.Client.Supervisor * Update lib/grpc/client/supervisor.ex * Format code - verify author --------- Co-authored-by: Micah Cooper <micah.cooper@mimic.com> Co-authored-by: Adriano Santos <solid.sistemas@gmail.com> Co-authored-by: Micah Cooper <mrmichacooper@gmail.com>
Author
|
Note: this branch is based on tag |
Backport of elixir-grpc#493 to the 0.11.x branch. When `build_real_channels` stores `{:error, reason}` entries for failed connections, the disconnect handler crashes because it only pattern-matches `{:ok, ch}` tuples. Add a catch-all clause to skip failed channels and wrap `adapter.disconnect/1` in a rescue/catch to prevent crashes from propagating. Fixes elixir-grpc#492 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7242959 to
ac759c3
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ac759c3 to
1f6bd68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #493 to the
0.11.xline (branched fromv0.11.5).GRPC.Client.Connection.handle_call/3for{:disconnect, ...}only pattern-matches{_key, {:ok, ch}}when iteratingstate.real_channels. However,build_real_channels/4can store{:error, reason}entries for failed connections, causing aFunctionClauseErroron disconnect.This is the same fix merged via #493 for 1.0.0-rc:
_ -> :okclause to skip channels that failed to connectadapter.disconnect/1indo_disconnect/2withrescue/catchfor resilienceRelated issues
Test plan
mix test)🤖 Generated with Claude Code