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

Thrown exception on every aggregator call #460

Closed
tylerhennessy opened this issue Jul 12, 2024 · 2 comments · Fixed by #462
Closed

Thrown exception on every aggregator call #460

tylerhennessy opened this issue Jul 12, 2024 · 2 comments · Fixed by #462

Comments

@tylerhennessy
Copy link

I am running a simple aggregation like this:

var results = provider.AggregationSet().GroupBy(user => user.RecordShell.SessionId).CountGroupMembers().ToList();

It correctly gets the results, but looking in the Debug Output, it is throwing an exception every time. I debugged into it and it appears like in the Dispose method of the AggregationEnumerator, if the _cursor is not 0, we try and delete the cursor. The only problem is UseCursor is set to false in this case, so _cursor defaults to -1 and never changes. Since it is not 0, we try and delete it and it fails with ERR invalid cursor.

Seems like if _cursor is -1 or UseCursor is false in the Dispose method, we should not be trying to delete the cursor and waste the overhead of executing another command and throwing an exception.

@tylerhennessy
Copy link
Author

I updated the Dispose method to early out if cursor is 0 or -1 and the average latency for the aggregate call went from 40 ms to 10 ms and obviously didn't log exceptions on every call anymore

@tylerhennessy
Copy link
Author

Thanks for the quick turnaround. Applied your change locally and verified it fixes my issue. Looking forward to it getting published.

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 a pull request may close this issue.

1 participant