Hi Elixir community,
I’m encountering an intermittent {:error, %OAuth2.Error{reason: :timeout}}
error while making OAuth2 API calls within Task.async
processes. Even though I’ve set the recv timeout
to 30 seconds, the error occasionally occurs before that time, seemingly for these asynchronous calls.And it rarely occurs to the non synchronous calls too.
Details:
- OAuth2 library: I’m using the
oauth2
library (~> 2.0). - Task context: The error appears for API calls made within
Task.async
blocks. - Regular interval: The timeout error seems to occur at roughly consistent intervals, despite the higher timeout setting.
Seeking help:
I’m hoping the community can help me identify the root cause of this intermittent timeout issue and suggest solutions for ensuring reliable OAuth2 authentication within my asynchronous tasks. Any insights on potential bottlenecks, library-specific settings, or alternative approaches to asynchronous API calls would be greatly appreciated.
I’m happy to provide further details or clarify any aspect of this issue as needed.
Thanks in advance for your assistance!