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
When a SQL command is interrupted because the request was cancelled, the SQL client throws an SqlException with a message containing "Operation cancelled by user". We cannot filter out this exception in our default UnhandledExceptionFilter because we do not have a dependency from our main IdentityServer package to the SqlClient package. But it's an annoying thing for our users and it's been brought up in support a few times.
Even though we cannot filter on the type we can filter on the name of the type. We can also filter on the message. That way we could add the SqlException to filtered out messages. We should probably also filter for the message to contain "Operation cancelled by user" to be safe. That would however not work on non-english installs of Windows/SQL Server.
Another case to handle is when the client makes a timeout and cancels the request because processing simply has taken too long. I've seen this in a support case where the DB query took a long time. It looks like the client then gave up and cancelled the request. In this case, the cancellation is something that should still be logged as it was caused by a too long-running request. Would it be possible to check the request processing time in the unhandled exception handler and still log the aborted request if it has taken more than 5(?) seconds to process?
The text was updated successfully, but these errors were encountered:
AndersAbel
changed the title
Consider adding SqlException Operation Cancelled to exception filter
Consider reworking Operation Cancelled to exception filter
Oct 28, 2024
When a SQL command is interrupted because the request was cancelled, the SQL client throws an
SqlException
with a message containing "Operation cancelled by user". We cannot filter out this exception in our default UnhandledExceptionFilter because we do not have a dependency from our main IdentityServer package to the SqlClient package. But it's an annoying thing for our users and it's been brought up in support a few times.Even though we cannot filter on the type we can filter on the name of the type. We can also filter on the message. That way we could add the SqlException to filtered out messages. We should probably also filter for the message to contain "Operation cancelled by user" to be safe. That would however not work on non-english installs of Windows/SQL Server.
Another case to handle is when the client makes a timeout and cancels the request because processing simply has taken too long. I've seen this in a support case where the DB query took a long time. It looks like the client then gave up and cancelled the request. In this case, the cancellation is something that should still be logged as it was caused by a too long-running request. Would it be possible to check the request processing time in the unhandled exception handler and still log the aborted request if it has taken more than 5(?) seconds to process?
The text was updated successfully, but these errors were encountered: