KB4016361 - FIX: Service Broker endpoint connections aren't closed after an availability group failover in SQL Server


Assume that you have a SQL Service Broker (SSB) application deployed as part of Always On availability groups (AGs) in Microsoft SQL Server, and then you use AG listener to connect. After an AG failover, the SSB outgoing connections on the original primary replica are left open. This causes SSB incoming messages to be dropped because the databases are read-only or inaccessible.

Therefore, it manifests that SSB messages are stuck in the transmission queue, and more than one Service Broker connections exist in the AG.


Cumulative Update Information for SQL Server:

This issue is fixed in the following cumulative updates for SQL Server:

Cumulative Update 6 for SQL Server 2016 RTM

Cumulative Update 3 for SQL Server 2016 SP1

Cumulative Update 5 for SQL Server 2014 SP2

Cumulative Update 12 for SQL Server 2014 SP1

Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

Latest cumulative update for SQL Server 2016

Latest cumulative update for SQL Server 2014

Note With this fix, SQL Server will close both incoming and outgoing SSB connections to the old primary Availability Group replica during failover, so that the messages which were getting dropped prior to this fix, will remain in the queue and they will get redirected to the new primary replica as soon as connections are established with the new primary replica, leaving no dropped or missing messages.

Service Pack Information for SQL Server:

This issue is fixed in the following service packs for SQL Server:

       Service Pack 4 for SQL Server 2012

       Service Pack 2 for SQL Server 2016

For more information about how to obtain the latest service pack, see How to obtain the latest service pack for SQL Server 2012

About Service packs for SQL Server

Service packs are cumulative. Each new service pack contains all the fixes that are in previous service packs, together with any new fixes. Our recommendation is to apply the latest service pack and the latest cumulative update for that service pack. You do not have to install a previous service pack before you install the latest service pack. Use Table 1 in the following article for finding more information about the latest service pack and latest cumulative update.

How to determine the version, edition and update level of SQL Server and its components


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


Learn about the terminologythat Microsoft uses to describe software updates.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!