Details
-
Bug
-
Resolution: Unresolved
-
Test Blocker
-
None
-
DOC-2022-S16, DOC-2022-S17, DOC-2022-S18
Description
In the example, you make condition on maxAttemps but this is wrong .When you do that, at first insertion try, if the error is gocb.ErrDocumentExists, then it should return error but in this code it will return nil, cause maxAttempts == 0 check will return false. On another case, lets say server will give timeout error 3 times, so this code will try 3 times to insert. So maxAttempts will be 0 cause it is decreased by one every iteration. In this case when last insert call return gocb.ErrDocumentExists, we expect to return nil but due to maxAttemps is 0, maxAttempts == 0 will return error and final response will be error but it should return nil. I will add the fixed solution to the attachment.
Reporter: SAFA YILDIRIM
E-mail: safayildirim54@gmail.com