(Republishing, or using this info in a commercial product/website, is prohibited without permission. All other uses are permitted. If in doubt, please ask.)

WAITFOR_PER_QUEUE

(Back to main page…)

Description:

This wait type is when a Service Broker worker thread is waiting for a message to be received on a specific queue as part of an activation procedure.

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:

2012

Removed in SQL Server version:

N/A

Extended Events wait_type value:

The map_key value in sys.dm_xe_map_values is 829 in 2012 and 848 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:

The wait time for each wait incurred may be up to the timeout specified in the WAITFOR (RECEIVE) statement (or 60 seconds if no timeout is specified). This is a normal wait to see in any environment using Service Broker activation procedures.

Known occurrences in SQL Server (list number matches call stack list):

  1. Waiting for a message to be received on a specific Service Broker queue as part of an activation procedure

Abbreviated call stacks (list number matches known occurrences list):

  1. SOS_Task::PostWait+0x6f
    WaitableBase::Wait+0x19c
    SOS_RWLock::GetLongWait+0x221
    CSsbWaitForGlobalManager::InternalTakeOffWaiterListAndNotifyNext+0x275
    CSsbWaitForGlobalManager::TakeOffWaiterListAndNotifyNext+0x8a
    CXStmtReceive::ExecuteWaitFor+0x172
    CXStmtReceive::XretExecute+0x17c
    CMsqlExecContext::ExecuteStmts<1,1>+0x7ed
    CMsqlExecContext::FExecute+0xa6e
    CSQLSource::Execute+0xa34
    CSbActivationProcTask::Execute+0xdfe
    CSbTask::TaskStart+0x136
    CSbTask::BeginTaskStart+0x17
    SOS_Task::Param::Execute+0x236
    SOS_Scheduler::RunTask+0xad
    SOS_Scheduler::ProcessTasks+0x3d0
    SchedulerManager::WorkerEntryPoint+0x2a1
    SystemThread::RunWorker+0x91