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

Feature: Timeout for client if server is offline #3229

Open
2 tasks done
InZan17 opened this issue Dec 28, 2023 · 0 comments
Open
2 tasks done

Feature: Timeout for client if server is offline #3229

InZan17 opened this issue Dec 28, 2023 · 0 comments
Labels
feature New feature or request topic:rust This is related to the Rust embedded library triage This issue is new

Comments

@InZan17
Copy link

InZan17 commented Dec 28, 2023

Is your feature request related to a problem?

I am hosting the surreal client and server on separate systems. If the client successfully connect to the server but then I close the server and run a query on the client, it will keep awaiting until I turn the server back on.

For my usecase this is relevant because I am using surrealdb for my discord bot and some commands will read/write to the database. If the database is down then the commands that uses the database will stop responding and once it's up again all the queries will go through and it'd be a bit too late to respond to the users command and they'd also be clueless that the configuration they did a while ago finally went through.

Describe the solution

A solution could be to instead of waiting for the server to come online, return an error saying the server is offline. I also understand that the current way of doing it also has some pros. So this could maybe be behind a feature flag, or a method on the client to specify if it should wait for a response or not.

Alternative methods

I've tried using tokio::time::timeout which will return an error after a certain amount of time. This works but the problem is that it doesn't stop the query and the query will still go through once the server is on again.

SurrealDB version

1.0.2 for linux on x86_64

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@InZan17 InZan17 added feature New feature or request triage This issue is new labels Dec 28, 2023
@kearfy kearfy added the topic:rust This is related to the Rust embedded library label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request topic:rust This is related to the Rust embedded library triage This issue is new
Projects
None yet
Development

No branches or pull requests

2 participants