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.
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 likeNotMaster
. In this case, mongobetween would extract the error and use the Go driver'sProcessError
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 theWriteWireMessage
orReadWireMessage
calls fail. This is propagated upward sohandleConnection
returns the error to the goroutine launched byProxy.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.