[GODRIVER-1499] Remove timeout check from server selection fast path Created: 28/Feb/20  Updated: 28/Oct/23  Resolved: 08/Apr/20

Status: Closed
Project: Go Driver
Component/s: Server Selection
Affects Version/s: None
Fix Version/s: 1.4.0

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


 Description   

In GODRIVER-1404, we introduced a server selection fast path that attempts to select a server once. If the initial selection fails, we call Subscribe and wait for new updates. The fast path still checks for ctx.Done and server selection timeout. We can remove this check because the fast path is arguably non-blocking and if the context has expired, it'll either be checked in the Subscribe path if initial selection fails or in WriteWireMessage before we send the command to the server. This basically makes it so we always attempt server selection once, regardless of the context/timeout.



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

Author:

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

Message: GODRIVER-1499 Remove timeout checks from server selection fast path (#356)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/94b769fb184c3ee9a2e5a178f8bbc14684ad6e2c

Comment by David Bartley [ 03/Apr/20 ]

Thanks!

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

https://github.com/mongodb/mongo-go-driver/pull/356

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