AspNetCoreOData icon indicating copy to clipboard operation
AspNetCoreOData copied to clipboard

Async query enumeration and cancellation support for long running queries

Open henning-krause opened this issue 3 years ago • 5 comments

Note: I've reopened this PR since the target branch name changes to main. The original PR can be found here: https://github.com/OData/AspNetCoreOData/pull/324 and was already approved by @corranrogue9.

A long time ago I created an issue to properly cancel long running queries (when the HttpContext.RequestAborted cancellation token is triggered) for the 7.9 version of this code. This was never solved, I think mainly because most of the code is still synchronous.

Now that I moved on to AspNetCoreOData I'm facing the same problem and gave it another shot.

@xuzhg I know that this PR is far from complete. But I wanted to get an opinion from you if I'm moving in the right direction with this and if you would approve this PR once it's complete before I put more effort in this.

For now, I have mainly redesigned the TruncatedCollection to properly support async enumeration (and remove the buffering of the whole response along with this change) as well as the ODataResourceSetSerializer.

So, for paged queries, this approach works.

henning-krause avatar Jan 09 '22 10:01 henning-krause

@KenitoInc Is there anything I can to to speed up the review?

henning-krause avatar Feb 16 '22 12:02 henning-krause

Thanks for the review @corranrogue9. I'm a little swamped right now but will get back to this ASAP.

henning-krause avatar May 09 '22 09:05 henning-krause

@henning-krause hoping you'd be able to complete this sometime! Would be cool if cancellation token is going to be supported.

akhyarkamili avatar Aug 09 '22 11:08 akhyarkamili

@henning-krause any chance?

SymbioticKilla avatar Feb 02 '23 13:02 SymbioticKilla

@SymbioticKilla Unfortunately, I won't have time for this in the foreseeable future.

henning-krause avatar Feb 02 '23 13:02 henning-krause