globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

socket: only send client metadata once per socket #105

Closed domodwyer closed 6 years ago

domodwyer commented 6 years ago

Periodic cluster synchronisation calls isMaster() which currently resends the "client" metadata every call - the spec specifies:

isMaster commands issued after the initial connection handshake MUST NOT
contain handshake arguments

This hotfix prevents subsequent isMaster() calls from sending the client metadata again - fixes #101 and fixes #103.

Thanks to @changwoo-nam @qhenkart @canthefason @jyoon17 for spotting the initial issue, opening tickets, and having the problem debugged with a PoC fix before I even woke up.