(Republishing, or using this info in a commercial product/website, is prohibited without permission. All other uses are permitted. If in doubt, please ask.)
Description:
This wait type is when a thread is calling the Windows CryptImportKey function.
(Books Online description: N/A)
Questions/comments on this wait type? Click here to send Paul an email, especially if you have any information to add to this topic.
Added in SQL Server version:
2008
Removed in SQL Server version:
N/A
Extended Events wait_type value:
The map_key value in sys.dm_xe_map_values is 422 in 2008 and 2008 R2, 470 in 2012, and 486 in 2014 RTM. After 2014 RTM, you must check the DMV to get the latest value as some map_key values have changed in later builds.
Other information:
If you see long waits for this wait type, have your infrastructure team investigate performance issues with servers that provide cryptographic services to the domain (for instance, the server for an Enterprise Key Management system).
Note that when a thread calls out to Windows, the thread changes from non-preemptive (SQL Server controls the thread) to preemptive (Windows controls the thread) mode. The thread’s state will be listed as RUNNING, as SQL Server doesn’t know what Windows is doing with the thread.
Known occurrences in SQL Server (list number matches call stack list):
- Importing a key (in this case, while initializing TDS while starting the instance)
- Importing an asymmetric key (in this case, to decrypt a column value)
- Importing a key (in this case, as part of compiling a certificate-signed stored procedure)
And other similar stacks.
Abbreviated call stacks (list number matches known occurrences list):
- SOS_Task::PopWait+b1
SOS_ExternalAutoWait::~SOS_ExternalAutoWait+7c
SOS_Task::AutoSwitchPreemptive::~AutoSwitchPreemptive+5d
CSECCryptoContext::ImportKey+166
CSECPrivateKey::InitFromBytes+17e
CSECCertificate::CreateNew+2f8
CSECFallBackCert::Init+6f6
CSECFallBackCert::InitInstance+174
GetFallBackCertContext+10
Ssl::InitializeListener+334
SNIInitializeListener+550
NodeListener::EndpointSet::Initialize+13b
NodeListener::Initialize+4f
SNIStartListening+7e
TDSSNIClient::Init+230
InitializeTDS+61
FRunCommunicationsManager+4e
CommunicationsManager+3c6
SOS_Task::Param::Execute+21e
SOS_Scheduler::RunTask+ab - SOS_Task::PopWait+b1
SOS_ExternalAutoWait::~SOS_ExternalAutoWait+7c
SOS_Task::AutoSwitchPreemptive::~AutoSwitchPreemptive+5d
CSECCryptoContext::ImportKey+166
CSECPublicKey::Init+f1
CSECAsymmetricKey::InitFromMD+f6
GetAsymKeyProperty+da
SsvarAsymKeyPropI4Wstr+235
CEsExec::GeneralEval4+e7
CQScanFilterNew::GetRowHelper+55
CQScanNLJoinNew::GetRowHelper+4f
CQScanNLJoinNew::GetRowHelper+4f
CQScanNLJoinNew::GetRowHelper+f4
CQScanNLJoinNew::GetRowHelper+4f
CQScanNLJoinNew::GetRowHelper+4f
CQueryScan::GetRow+81
CXStmtQuery::ErsqExecuteQuery+54a
CXStmtSelect::XretExecute+2e7
CMsqlExecContext::ExecuteStmts<1,1>+427
CMsqlExecContext::FExecute+a43
CSQLSource::Execute+86c
process_request+a57 - SOS_Task::PopWait+b1
SOS_ExternalAutoWait::~SOS_ExternalAutoWait+7c
SOS_Task::AutoSwitchPreemptive::~AutoSwitchPreemptive+5d
CSECCryptoContext::ImportKey+166
CSECPublicKey::Init+f1
CSECCertificate::GetPublicKey+132
CSECCryptoServices::VerifySignature+187
CSECExecAsCompileServices::SetToObject+2ba
CSQLSource::FCompile+1e7c
CSQLSource::FCompWrapper+dd
CSQLSource::Transform+445
CSQLSource::Execute+401
CStmtExecProc::XretLocalExec+25a
CStmtExecProc::XretExecExecute+4e8
CXStmtExecProc::XretExecute+38
CMsqlExecContext::ExecuteStmts<1,1>+427
CMsqlExecContext::FExecute+a43