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

Platform database benchmarks broken #1822

Closed
sebastienros opened this issue Mar 27, 2023 · 10 comments
Closed

Platform database benchmarks broken #1822

sebastienros opened this issue Mar 27, 2023 · 10 comments

Comments

@sebastienros
Copy link
Member

Error trying to populate database cache: System.ArgumentOutOfRangeException: 'dueTime' must be less than or equal to '4294967294'. (Parameter 'dueTime')
Actual value was 4294967295.
  at System.ArgumentOutOfRangeException.ThrowGreater[T](String paramName, T value, T other)
  at System.Threading.TimerQueueTimer.GetMilliseconds(TimeSpan time, String parameter)
  at System.Threading.TimerQueueTimer.Change(TimeSpan dueTime, TimeSpan period)
  at System.Threading.CancellationTokenSource.CancelAfter(UInt32 millisecondsDelay)
  at System.Threading.CancellationTokenSource.CancelAfter(TimeSpan delay)
  at Npgsql.Util.ResettableCancellationTokenSource.Stop()
  at Npgsql.Internal.NpgsqlWriteBuffer.Flush(Boolean async, CancellationToken cancellationToken)
  at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
  at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|213_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
  at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
  at Npgsql.PoolingDataSource.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
  at Npgsql.PoolingDataSource.<Get>g__RentAsync|28_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
  at Npgsql.NpgsqlConnection.<>c__DisplayClass166_0.<<StartBindingScope>g__StartBindingScopeAsync|0>d.MoveNext()
@sebastienros
Copy link
Member Author

/cc @roji

@vonzshik
Copy link

There was a change around timers in dotnet/runtime#83604. Might be the reason?

@sebastienros
Copy link
Member Author

@vonzshik definitely related, this exception is a new behavior from this PR, thanks

@sebastienros
Copy link
Member Author

@vonzshik
Copy link

Yep. Also notice that it casts from TimeSpan to UInt32 - this probably is the reason:

at System.Threading.CancellationTokenSource.CancelAfter(UInt32 millisecondsDelay)
  at System.Threading.CancellationTokenSource.CancelAfter(TimeSpan delay)
  at Npgsql.Util.ResettableCancellationTokenSource.Stop()

@sebastienros
Copy link
Member Author

Agreed, because the checks are the same (ArgumentOutOfRangeException.ThrowIfGreaterThan)

@vonzshik
Copy link

I took a closer look. There is a thing called UnsignedInfinite which is used by the timer as infinite timeout. And it seems because TimerQueueTimer.Change now accepts TimeSpan and tries to validate it (without accounting for uint to TimeSpan conversion) we get the exception.

@sebastienros
Copy link
Member Author

Can you comment on the PR to let them know?

@vonzshik
Copy link

Sure.

@DamianEdwards
Copy link
Member

This is fixed now.

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

No branches or pull requests

3 participants