You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an application that polls canister methods and makes roughly 200/300 calls/s. After a few minutes the app is started these errors start to pop up: Post "<canister endpoint>": context deadline exceeded Post "<canister endpoint>": dial tcp <ip>: i/o timeout
I tweaked a bit the source code by modifying a few client configs inside the agent but i think the most problematic is that i don't see any
resp.Body.Close()
in the client methods (specifically Client.Call and Client.post methods).
So my proposals are:
Add the missing function calls on those methods
Modify the Agent constructor by adding an additional param to allow for customs http clients
The text was updated successfully, but these errors were encountered:
Your observations regarding missing resp.Body.Close() calls are valid concerns, as not properly closing response bodies can lead to connection leaks over time. I will review the implementation next week and ensure that response bodies are properly closed where necessary.
Regarding your second proposal, adding support for custom HTTP clients in the constructor could indeed provide more flexibility for fine-tuning connection settings, timeouts, and transport behavior. This could be particularly useful for high-frequency polling scenarios like yours.
You can expect a PR somewhere next week to fix this.
Note that boundary nodes also enforce rate limits. While I haven’t encountered issues with dial tcp <ip>: i/o timeout, I have experienced cases where boundary nodes refused requests due to rate limiting.
I have an application that polls canister methods and makes roughly 200/300 calls/s. After a few minutes the app is started these errors start to pop up:
Post "<canister endpoint>": context deadline exceeded
Post "<canister endpoint>": dial tcp <ip>: i/o timeout
I tweaked a bit the source code by modifying a few client configs inside the agent but i think the most problematic is that i don't see any
resp.Body.Close()
in the client methods (specifically
Client.Call
andClient.post
methods).So my proposals are:
Agent
constructor by adding an additional param to allow for customs http clientsThe text was updated successfully, but these errors were encountered: