Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Add timeouts around IO calls during authenticate #48

Merged
merged 1 commit into from
Jan 19, 2015

Conversation

macb
Copy link
Contributor

@macb macb commented Jan 15, 2015

We actually ended up with a process that was completely blocked trying to io.ReadFull from a connection that may never have responded. It seemed like it might be best to have some form of timeout. I chose to do the * 10 to keep the test suite green and allow for slightly longer authenticate calls as they are made only as part of a new connection.

@macb
Copy link
Contributor Author

macb commented Jan 19, 2015

ping @samuel any thoughts?

@samuel
Copy link
Owner

samuel commented Jan 19, 2015

Overall looks great. It may be better to set the timeout at the start and defer to unset it. This way it limits the total time of the authenticate rather than extending per read/write. Either way it's definitely good to have the timeout.

Thanks for the patch.

@macb
Copy link
Contributor Author

macb commented Jan 19, 2015

Ah, didn't think of that approach.

I took this path since I wanted to keep it relatively similar to the other examples I saw in conn.go. I'm not particularly attached to either and I know this approach is effective at least (we have the applied patch in production).

@samuel
Copy link
Owner

samuel commented Jan 19, 2015

That's cool. Makes sense.

samuel added a commit that referenced this pull request Jan 19, 2015
Add timeouts around IO calls during authenticate
@samuel samuel merged commit fa6674a into samuel:master Jan 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants