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

Cache throws ArgumentOutOfRangeException exception #666

Open
JanOuborny opened this issue May 12, 2020 · 1 comment
Open

Cache throws ArgumentOutOfRangeException exception #666

JanOuborny opened this issue May 12, 2020 · 1 comment
Labels

Comments

@JanOuborny
Copy link
Contributor

JanOuborny commented May 12, 2020

 ---> System.ArgumentOutOfRangeException: Time-out interval must be less than 2^32-2. (Parameter 'dueTime')
   at System.Threading.Timer..ctor(TimerCallback callback, Object state, TimeSpan dueTime, TimeSpan period)
   at RiotSharp.Caching.Cache.StartObserving[TK](TK key, TimeSpan timeSpan)
   at RiotSharp.Caching.Cache.Add[TK,TV](TK key, TV value, TimeSpan timeSpan, Boolean isSliding)
   at RiotSharp.Caching.Cache.Add[TK,TV](TK key, TV value, TimeSpan slidingExpiry)
   at RiotSharp.Endpoints.MatchEndpoint.MatchEndpoint.GetMatchTimelineAsync(Region region, Int64 matchId)
@JanOuborny JanOuborny added the bug label May 12, 2020
@Rezga12
Copy link
Contributor

Rezga12 commented May 13, 2020

I couldn't reproduce the bug, but after some static analysis I caught on next cases:

An Exception is thrown by Ststem.Threading.Timer constructor and it says that parameter named 'dueTIme' is greater than 2^32 (I.E. integer upper limit).

The Actual value passed to this Constructor is MatchEndpoint,MatchTtl which is defined as:

private static readonly TimeSpan MatchTtl = TimeSpan.FromDays(60);

60 days are 5 billion Milliseconds that's greater than 2^32(about 2 billion) MS.

I think reducing the match TTL in cache might help.

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

No branches or pull requests

2 participants