-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mint adapter and :unknown messages #357
Comments
Last time i was getting this type of errors, these were messages from another process (as far as i remember messages like Error can be reproduced by sending any message to process, which is holding Maybe for this type of errors would be more suitable to add logging, ignore this message and recall |
@ericmj Could you give us a hand here? |
I have opened an issue for a feature so that you can match on specific mint connection messages: elixir-mint/mint#247. IIRC tesla opens a single connection, sends a request, and closes the connection. If that's correct you can run in passive mode instead so you don't have to manage any messages: https://hexdocs.pm/mint/Mint.HTTP.html#module-mode. |
Hello, what's the next for this issue of 1, Currently, Thanks! |
I think the next step would be to use Also related to #301 |
I think we should move on with the passive mode for mint adapter, and direct people to use finch for persistent connections & pooling. Any thoughts on that? |
@teamon I think that's the right approach. |
according to Mint's documentation (see https://hexdocs.pm/mint/Mint.HTTP.html#stream/2) Mint.HTTP.stream/2 (called here: https://github.com/teamon/tesla/blob/v1.3.2/lib/tesla/adapter/mint.ex#L316) will return :unknown if the message passed to it is not destined for the current connection. The documentation suggests to handle this like a normal message:
long story short, this seems to indicate to me that messages that stream/2 labels as :unknown are not errors, just need to be handled differently (keep in mind: I am very much not an expert)
the Mint adapter on the other hand, converts these into errors (from https://github.com/teamon/tesla/blob/v1.3.2/lib/tesla/adapter/mint.ex#L307):
We do observer this behaviour from time to time (we get
{:error, :unknown}
responses), but I don't know how to reproduce it / write a failing test for it.The text was updated successfully, but these errors were encountered: