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 timeout to unix socket connection #22

Open
jn9e9 opened this issue Jan 29, 2021 · 2 comments
Open

Add timeout to unix socket connection #22

jn9e9 opened this issue Jan 29, 2021 · 2 comments
Labels
small Effort label

Comments

@jn9e9
Copy link
Collaborator

jn9e9 commented Jan 29, 2021

rust client has a timout on the unix socket connection (of configurable length) which allows the client application to recover (i.e. detect failure and compensate if possible) if the parsec daemon is not responding. Go client needs same functionality - default of 1s likely sensible.

@jn9e9
Copy link
Collaborator Author

jn9e9 commented Feb 10, 2021

will need ability to mock the parsec service at the unix socket level, so will depend on #19

@hug-dev hug-dev added the small Effort label label Feb 11, 2021
@jn9e9
Copy link
Collaborator Author

jn9e9 commented Oct 31, 2021

For dialling, we should be able to use a dialler with a context, having deadline set: https://pkg.go.dev/net#Dialer
For individual reads/writes, we'll have to set deadlines on each read/write for the timeout period - this is ok because the client should only be used single threaded (i.e. one request/response in flight at once), so we'll never get overlapping call windows messing up the deadlines. go doesn't let us set timeouts per read/write, just read and write deadlines on the connection as a whole

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Effort label
Projects
None yet
Development

No branches or pull requests

2 participants