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

Drivers could mark mongobetween Unknown for server issues #16

Open
divjotarora opened this issue Jun 24, 2020 · 0 comments
Open

Drivers could mark mongobetween Unknown for server issues #16

divjotarora opened this issue Jun 24, 2020 · 0 comments

Comments

@divjotarora
Copy link
Contributor

divjotarora commented Jun 24, 2020

The README says that mongobetween appears as an always-available mongos server, but I believe a driver would mark mongobetween as Unknown if there were a server error like NotMaster. In this case, mongobetween would extract the error and use the Go driver's ProcessError function to mark the actual mongos Unknown, which is correct, but would also proxy the message back to the original driver, which would then mark mongobetween Unknown per the error handling section of the SDAM spec.

EDIT: I think the same is true for connection errors. mongo.RoundTrip returns an error if the WriteWireMessage or ReadWireMessage calls fail. This is propagated upward so handleConnection returns the error to the goroutine launched by Proxy.accept, which closes the connection. This would show up in the application as a non-timeout network error, which would cause the application to mark the proxy as Unknown and clear its connection pool.

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

Successfully merging a pull request may close this issue.

1 participant