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

Consider reworking Operation Cancelled to exception filter #1617

Open
AndersAbel opened this issue Oct 28, 2024 · 0 comments
Open

Consider reworking Operation Cancelled to exception filter #1617

AndersAbel opened this issue Oct 28, 2024 · 0 comments

Comments

@AndersAbel
Copy link
Member

AndersAbel commented 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?

@AndersAbel AndersAbel changed the title Consider adding SqlException Operation Cancelled to exception filter Consider reworking Operation Cancelled to exception filter Oct 28, 2024
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

1 participant