You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which version of Duende IdentityServer are you using?
6.1.0
Which version of .NET are you using?
6.0
Describe the bug
When calling introspection with an expired PersistedGrant, IDS occasionally runs a full table scan (SELECT p."Id", p."ClientId", p."ConsumedTime", p."CreationTime", p."Data", p."Description", p."Expiration", p."Key", p."SessionId", p."SubjectId", p."Type" FROM "PersistedGrants" AS p) on the PersistedGrants after attempting to delete the record. After which an exception is logged The database operation was expected to affect 1 row(s), but actually affected 0 row(s); .
To Reproduce
I cannot reproduce it at will, but it does occur regularly in our environment. We are running 10 instances of IDS behind a round robin load balancer. My best guess is several introspection requests come in simultaneously and two servers are attempting to delete the same record.
This behavior did not appear occur prior to upgrading from 6.1.0 to 6.0.4
This has turned out to be a logging issue with the DbConcurrencyException thrown when EF tried to delete the PersistedGrant that was already deleted.
We found some issues gitlab for Serilog that implied logging serialization of some DbExceptions cause a DbSet property to be referenced and thus queried. We're using NLog, but it appears to be a similar issue.
The root Serilog issue appears to be resolved, at least if you use Serilog.Exceptions. I couldn't find a similar issue for NLog, so I plan on raising an issue with NLog if it is repeatable in a sample app. We're also evaluating if we can use the Serilog fix as a guide to resolve this in NLog.
Which version of Duende IdentityServer are you using?
6.1.0
Which version of .NET are you using?
6.0
Describe the bug
When calling introspection with an expired PersistedGrant, IDS occasionally runs a full table scan (
SELECT p."Id", p."ClientId", p."ConsumedTime", p."CreationTime", p."Data", p."Description", p."Expiration", p."Key", p."SessionId", p."SubjectId", p."Type" FROM "PersistedGrants" AS p
) on thePersistedGrants
after attempting to delete the record. After which an exception is loggedThe database operation was expected to affect 1 row(s), but actually affected 0 row(s);
.To Reproduce
I cannot reproduce it at will, but it does occur regularly in our environment. We are running 10 instances of IDS behind a round robin load balancer. My best guess is several introspection requests come in simultaneously and two servers are attempting to delete the same record.
This behavior did not appear occur prior to upgrading from 6.1.0 to 6.0.4
Expected behavior
A full table scan should not be performed.
Log output/exception with stacktrace
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: