BROKER_TASK_STOP Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: SOS_SCHEDULER_YIELD Wait TypeRelated pillar: Performance & Troubleshooting

Is It a Problem?

No. It is a lifecycle wait for the Service Broker task handlers, it is commonly filtered as benign, and Get Wait Statistics filters it out by default. On our SQL Server 2025 lab its total was larger than the instance’s uptime, which fits several handlers waiting at the same time.


What It Means

Microsoft describes it as the Service Broker queue task handler trying to shut down the task, with the state check serialised. A handler with nothing to do can wait up to ten seconds here before shutting down, and the wait grows steadily on any instance where Broker is in use. msdb uses Service Broker for Database Mail, so most instances have it.


When It Does Matter

It does not. Its growth is timer arithmetic, not workload, and there is nothing to tune.

Service Broker health lives elsewhere. Messages that cannot be delivered sit in sys.transmission_queue with a transmission_status explaining why, activation procedure errors go to the error log, and conversations that are never ended pile up in sys.conversation_endpoints. The baseline to monitor is the row count in those two views staying flat. Get Service Broker Health and Database Mail Queue checks both.


The BROKER Family

These are the Service Broker background waits. Most of them tick over on every instance, whether or not you use Broker, because the threads behind them always exist. If one is near the top of your waits, start from the waits that usually matter instead.

  • BROKER_TO_FLUSHLazy flusher. Flushing in-memory transmission objects to a work table.Usually noise
  • BROKER_TASK_STOPTask shutdown. The queue task handler shutting a task down.Usually noise. This page.
  • BROKER_TRANSMITTERTransmitter idle. The two transmitter threads waiting for messages to send.Usually noise
  • BROKER_TRANSMISSION_TABLETransmission table. Documented as internal use only; tied to transmission bookkeeping.Usually noise
  • BROKER_TRANSMISSION_WORKTransmission work. Documented as internal use only.Usually noise
  • BROKER_EVENTHANDLEREvent handler. The primary Broker event handler waiting for its next event.Usually noise
  • BROKER_RECEIVE_WAITFORRECEIVE WAITFOR. A RECEIVE WAITFOR statement waiting for a message to arrive.Usually noise
  • BROKER_INIT and startup waitsStartup and shutdown. Broker initialising in each database, and its endpoint and startup machinery.Usually noise

Where To Go Next

BROKER_TASK_STOP is background noise on a healthy instance. If you are chasing a real problem, start with the waits that cost you time.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *