Skip to content

Suggestion: Address possible quantum punishment issue #14

@tcartwright

Description

@tcartwright

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.

Metadata

Metadata

Assignees

Labels

wontfixThis will not be worked on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions