-
Notifications
You must be signed in to change notification settings - Fork 230
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
Blocked in function cluster.AcquireSocket #134
Comments
Hi @leopoldfreeman I think this is probably related to #120 - there's a hotfix pending but it's a public holiday in England, so my colleagues probably won't see it until everyone is back. I'll close this as I think it should be resolved pretty soon but if it's not, please do reply and I'll reopen. Dom |
Hi @leopoldfreeman Try now, it should be better :) Dom |
Hi, @domodwyer I pulled the codes and rebuild the codes, the problem still exists. I checked the hotfix, it's not the same problem. |
My problem is: When mongodb is offline after the client established the connection to the DB, this line will block: iter := col.Find(bson.M{}).Iter() |
Hi @leopoldfreeman When running your test case, after a while I get:
Perhaps changing the socket timeout or sync timeout might help. Dom |
I checked it again. You're right. Thank you very much. |
Cool, glad it's working for you! |
When mongodb is offline, the client will be blocked in the function cluster.AcquireSocket. Can you add a timeout for this situation? For example, if the client cannot get a live socket in 5s, it will return an error. Thank you.
To reproduce the problem:
sudo iptables -I INPUT -p tcp --dport 27017 -s $CLIENT_IP -j REJECT --reject-with tcp-reset
sudo iptables -D INPUT 1
Codes:
The text was updated successfully, but these errors were encountered: