Skip to content
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

feat(agent): add timeout on write calls #426

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from

Conversation

hspedro
Copy link
Collaborator

@hspedro hspedro commented Dec 17, 2024

When sending a message via agent, the write connection does not have a default timeout, leading to blocking calls if the connections is unhealthy or simply a bad route to it. Thus, adding a write timeout to the writes so we fail but don't block. If deadline is exceeded then we log an error but don't close a connection, since it might fail due to bad route but not a broken pipe per-se. The new configuration can be found under: pitaya.buffer.agent.writetimeout, with 10s by default.

The timeout is set using SetWriteDeadline function from go net pkg: https://pkg.go.dev/net#Conn

@hspedro hspedro force-pushed the feat/agent-write-timeout branch 2 times, most recently from 0803937 to 7d97542 Compare December 17, 2024 19:42
@hspedro hspedro force-pushed the feat/agent-write-timeout branch 2 times, most recently from 3ef3eff to 930a149 Compare January 17, 2025 13:37
When sending a message via agent, the write connection does not have
a default timeout, leading to blocking calls if the connections is
unhealthy or simply a bad route to it. Thus, adding a write timeout
to the writes so we fail but don't block. If deadline is exceeded then
we log an error but don't close a connection, since it might fail due
to bad route but not a broken pipe per-se. The new configuration can
be found under: `pitaya.buffer.agent.writetimeout`, with 10s by deafult.

The timeout is set using `SetWriteDeadline` function from go net pkg:
https://pkg.go.dev/net#Conn
@hspedro hspedro force-pushed the feat/agent-write-timeout branch from 930a149 to 74298ad Compare January 17, 2025 13:57
@hspedro hspedro marked this pull request as ready for review January 17, 2025 13:57
@hspedro hspedro force-pushed the feat/agent-write-timeout branch from 7717e22 to 0f28ff2 Compare January 17, 2025 18:43
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