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

Add receive timeout #326

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Add receive timeout #326

merged 1 commit into from
Sep 20, 2023

Conversation

mostafa
Copy link
Member

@mostafa mostafa commented Sep 20, 2023

Ticket(s)

Description

This PR adds a small feature for having a context that times out when blocking on client.Receive. This helps prevents client.Receive from blocking the entire message flow, thus hanging the servers and clients. Note that by default the value is 0, which means it'll work just like before, until one sets a time limit. It is recommended to set it to a relative value that your queries might take to be answered by the database server. Also, this is different from the client.ReceiveDeadline, in that it doesn't kill the connection, but instead stops waiting to receive new values from the client connection.

Related PRs

N/A

Development Checklist

  • I have added a descriptive title to this PR.
  • I have squashed related commits together.
  • I have rebased my branch on top of the latest main branch.
  • I have performed a self-review of my own code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added docstring(s) and type annotations to my code.
  • I have made corresponding changes to the documentation (docs).
  • I have added tests for my changes.

Legal Checklist

@mostafa mostafa merged commit 6ed3b6e into main Sep 20, 2023
2 checks passed
@mostafa mostafa deleted the add-receive-timeout branch September 20, 2023 20:36
This was linked to issues Sep 20, 2023
@mostafa mostafa removed a link to an issue Sep 22, 2023
4 tasks
@mostafa mostafa mentioned this pull request Sep 24, 2023
12 tasks
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.

Add receive timeout
1 participant