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

Suggestion: Address possible quantum punishment issue #14

Open
tcartwright opened this issue Dec 9, 2024 · 1 comment
Open

Suggestion: Address possible quantum punishment issue #14

tcartwright opened this issue Dec 9, 2024 · 1 comment
Assignees
Labels
wontfix This will not be worked on

Comments

@tcartwright
Copy link

I noticed that you are not using the async methods when calling the web services. This can have very nasty effects upon a sql server.

[SQL Server CLR procedures and SQLCLR_QUANTUM_PUNISHMENT](https://dba.stackexchange.com/questions/164891/sql-server-clr-procedures-and-sqlclr-quantum-punishment )

[SQL Server CLR Threading](https://stackoverflow.com/questions/35116558/sql-server-clr-threading)

If the rest api takes a while, or dns takes a long time to resolve then your server will most likely hang as the server tries to punish your api. Sounds weird I know, but trust me from experience. This can be VERY VERY bad.

You really need to either do one of two things:

  • Use Thread.BeginThreadAffinity / Thread.EndThreadAffinity to release the thread management to the OS. Requires UNSAFE.
  • Utilize the async / await operators while periodically calling System.Threading.Thread.Sleep(0); which lets the thread scheduler know you are still alive by releasing your lock on the scheduler.
@EitanBlumin
Copy link
Collaborator

Hi @tcartwright .
I appreciate your concern. However, I don't believe it is necessary, considering the use of the timeout parameter.

@EitanBlumin EitanBlumin self-assigned this Dec 9, 2024
@EitanBlumin EitanBlumin added the wontfix This will not be worked on label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants