[GODRIVER-1405] "appname" is not not always sent in isMaster Created: 09/Nov/19  Updated: 28/Oct/23  Resolved: 17/Apr/20

Status: Closed
Project: Go Driver
Component/s: Server Discovery and Monitoring
Affects Version/s: None
Fix Version/s: 1.3.3

Type: Bug Priority: Major - P3
Reporter: David Bartley Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

It appears there's a couple places where isMaster requests are constructed:
1) https://github.com/mongodb/mongo-go-driver/blob/master/x/mongo/driver/topology/topology_options.go#L198
2) https://github.com/mongodb/mongo-go-driver/blob/master/x/mongo/driver/topology/server.go#L514

While both set "appname", the latter uses "s.cfg.appname", but afaict that value is never set (and I've confirmed from logs that client metadata is being received without "application"). This makes sense, since "appname" comes from https://github.com/mongodb/mongo-go-driver/blob/master/x/mongo/driver/topology/server_options.go#L24, but there's no "WithAppName(...) ServerOption" function.



 Comments   
Comment by Githook User [ 20/Apr/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1405 Remove topology.WithConnectionAppName (#377)
Branch: release/1.3
https://github.com/mongodb/mongo-go-driver/commit/76bc82c9ef006d92a89998617245b11f7a77618e

Comment by Githook User [ 20/Apr/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1405 Send app name on heartbeat and application connections (#366)
Branch: release/1.3
https://github.com/mongodb/mongo-go-driver/commit/116d850d19ec56da77499b529f85c8d40e1158d7

Comment by Githook User [ 20/Apr/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1405 Remove topology.WithConnectionAppName (#377)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/1ce974a902227d4c3ddbf45b1422d966bf1c1b5e

Comment by Githook User [ 17/Apr/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1405 Send app name on heartbeat and application connections (#366)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/162453d45f1585df33a13996a897d4ebc451d130

Comment by Divjot Arora (Inactive) [ 14/Apr/20 ]

Moving back to "Needs Triage". The previous commit fixed the issue when using WithConnString but we need to make this fix in client.go to correctly set the topology/server/connection options and actually propagate the app name.

I also didn't realize this when we first did this ticket, but we might be able to add a test using drivertest.ChannelConn or something similar.

Comment by Githook User [ 18/Nov/19 ]

Author:

{'name': 'iwysiu', 'username': 'iwysiu', 'email': 'isabella.siu@10gen.com'}

Message: GODRIVER-1405 set appname on ServerConfig (#226)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/c2d06af7698ee006f3c47eb4a3011f095fd03d25

Generated at Thu Feb 08 08:36:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.