[SERVER-32804] runClientFunctionWithRetries is not decrementing retry counter in some cases Created: 19/Jan/18  Updated: 15/Mar/18  Resolved: 05/Mar/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.7.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Randolph Tan
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-32806 retried findAndModify not using oplog... Closed
Related
Operating System: ALL
Sprint: Sharding 2018-02-26, Sharding 2018-03-12
Participants:
Linked BF Score: 0

 Description   

For example:
https://github.com/mongodb/mongo/blob/r3.7.1/src/mongo/shell/session.js#L358
https://github.com/mongodb/mongo/blob/r3.7.1/src/mongo/shell/session.js#L371



 Comments   
Comment by Randolph Tan [ 05/Mar/18 ]

Fixing SERVER-33475 should resolve the infinite loop seen in the build failure

Comment by Max Hirschhorn [ 19/Jan/18 ]

renctan, I think we're intentionally not decrementing the counter in those cases. The following is the comment thread in the code review from SERVER-31198. CC jack.mulrow

On 2017/12/21 22:25:01, jack.mulrow wrote:
> On 2017/12/21 18:53:30, maxh wrote:
> > Hmm, I didn't comment on this when reviewing
> > https://mongodbcr.appspot.com/172310001/, but I think one reason that the mongo
> > shell shouldn't decrement `numRetries` here is because it doesn't implement the
> > "server discovery and monitoring" Driver's specification to attempt to discover
> > the current primary after seeing a "not master" error. Decrementing `numRetries`
> > would make it so that two "not master" errors could occur in short succession
> > for the same command object and cause an error to be returned back to the
> > client, making retryable writes less useful in the mongo shell.
>
> That makes sense, but it still feels a little scary to retry without a bound.
> Could it be possible for the shell to get stuck in a loop if the
> connection was never closed for some reason, or if the server kept returning a
> "retryable" error?

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