[GODRIVER-2057] SRV polling is not spawned because options.MergeClientOptions doesn't handle uri properly Created: 22/Jun/21  Updated: 29/Jun/21  Resolved: 28/Jun/21

Status: Closed
Project: Go Driver
Component/s: Options & Configuration
Affects Version/s: 1.5.3
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Hoonmin Kim Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates GODRIVER-2056 SRV polling is not spawned because op... Closed
Related
related to GODRIVER-1507 SRV polling not performed if the URI ... Closed

 Description   

It seems that SRV polling is not spawned when using `opts.ApplyURI()` without (deprecated) deployment options.

That's because options.MergeClientOptions doesn't copy "uri" field. Then topology.New gets options with empty uri value, and polling is disabled.

	if t.cfg.uri != "" {
		t.pollingRequired = strings.HasPrefix(t.cfg.uri, "mongodb+srv://")
	}



 Comments   
Comment by Githook User [ 29/Jun/21 ]

Author:

{'name': 'Hoonmin Kim', 'email': 'harebox@gmail.com', 'username': 'hoonmin'}

Message: GODRIVER-2057 Fix uri merging on options.ClientOptions (#689)
Branch: release/1.5
https://github.com/mongodb/mongo-go-driver/commit/be28a1cd9dfaf78afd250b10492a9aacc93a2c1b

Comment by Githook User [ 29/Jun/21 ]

Author:

{'name': 'Hoonmin Kim', 'email': 'harebox@gmail.com', 'username': 'hoonmin'}

Message: GODRIVER-2057 Fix uri merging on options.ClientOptions (#689)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/6d6365b7ba31c6bb15903f26fbef38979bc260a1

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