Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default parameter ForceWaitTimeout to OpQuery and WaitForReply #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

dbcto
Copy link
Contributor

@dbcto dbcto commented Nov 25, 2021

Call of GetInstanceInfo() results in an endless loop in WaitForReply when replicasets may have changed primary and secondary, because there is never any data received even if replicaset got valid again.

dbcto and others added 6 commits September 27, 2021 21:40
…eply

Call of GetInstanceInfo() results in an endless loop in WaitForReply when replicasets may have changed primary and secondary, because there is never any data received even if replicaset got valid again
CHG: Added default parameter ForceWaitTimeout to OpQuery and WaitForR…
@ErikUniformAgri
Copy link

I had a similar problem after my internet and the connection were gone for a while. When the connection was reestablished I ended up in the same endless loop in WaitForReply. I used this code and added the ForceWaitTimeOut parameter to TgoMongoCollection.Find and the problem was gone

function TgoMongoCollection.Find(const AFilter,
AProjection: TBytes; const ANumberToSkip : Integer = 0): IgoMongoCursor;
// https://docs.mongodb.com/manual/reference/method/db.collection.find
var
Reply: IgoMongoReply;
begin
Reply := FProtocol.OpQuery(FFullName, [], ANumberToSkip, 0, AFilter, AProjection, True);
HandleTimeout(Reply);
Result := TgoMongoCursor.Create(FProtocol, FFullName, Reply.Documents, Reply.CursorId);
end;

@RadiRadiesel2
Copy link

Fork "tuurke63" using StopWatch instead of TDateTime does solve this problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants