TMDbLib icon indicating copy to clipboard operation
TMDbLib copied to clipboard

Timeouts may not be upheld

Open LordMike opened this issue 6 years ago • 4 comments

It's come to my attention that the Timeouts given to HttpClient (CancellationTokens) only apply to the actual request, and up till the response is "ready". Once the response is being read (as a Stream), the timeouts no longer apply.

We should ensure that our Timeouts work.

LordMike avatar Jan 23 '19 15:01 LordMike

I'm having this problem

ghost avatar Jan 29 '19 19:01 ghost

What are you experiencing?

LordMike avatar Jan 29 '19 19:01 LordMike

What are you experiencing?

I've been using your TMDBLib library for the last few years and it has been very good for me in that long period, but in the last few weeks the GetMovieAsync, GetTvShowAsync, DiscoverMoviesAsync and DiscoverTvShowsAsync methods (I only use these at the moment) have been slow in responses and sometimes returns null values, I still can not investigate why this is occurring but I believe it is related to the http request, it gets stuck for a long time even if X-RateLimit is OK

ghost avatar Jan 29 '19 20:01 ghost

Hmm. Certainly sounds like it. The result of the method is null?

If it's an error code of sorts, and the result is null - we should probably throw exceptions instead.. Feel like we've been over this before :O.

Would you like a timeout for the entire request, or a timeout for reading and writing, or something else entirely?

LordMike avatar Jan 29 '19 22:01 LordMike