Skip to content

fix(mint): explicitly support infinite retries - #579

Open
arrangabriel wants to merge 1 commit into
elixir-grpc:masterfrom
arrangabriel:feat/mint-infinite-retry
Open

fix(mint): explicitly support infinite retries#579
arrangabriel wants to merge 1 commit into
elixir-grpc:masterfrom
arrangabriel:feat/mint-infinite-retry

Conversation

@arrangabriel

@arrangabriel arrangabriel commented Aug 27, 2026

Copy link
Copy Markdown

Explicitly support retry: :infinity in the Mint adapter

The option already worked, because atoms are above integers in erlang term ordering.
This behavior was undocumented, and arguably supported only by accident.

Changes

  • :retry now documents and tests :infinity as an intentional value.
  • The exhaustion check moved into a State.retries_exhausted?/1 guard that names the special case instead of leaning on term ordering.
  • Invalid :retry values now raise ArgumentError instead of silently behaving in an unexpected way.
  • New optional GRPC.Client.Adapter.validate_opts/1 callback. GRPC.Client.Connection.connect/2 invokes it when the adapter exports it. Implemented only in the Mint adapter.

Heads-up for downstream test suites

Mox generates optional callbacks on mocks, so an existing Mox.defmock for
GRPC.Client.Adapter will export validate_opts/1 and raise
UnexpectedCallError unless it is stubbed. Adapters using the behaviour without
defining validate_opts/1 are fine.

@arrangabriel
arrangabriel force-pushed the feat/mint-infinite-retry branch from 976ac11 to 40bd8d4 Compare August 28, 2026 06:00
@arrangabriel
arrangabriel force-pushed the feat/mint-infinite-retry branch from 40bd8d4 to a22b64c Compare September 1, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant