A subscription isn't marked as deactivated after the distribution retention period for the subscription synchronization expires.
This problem is fixed in the following cumulative updates for SQL Server:
Note After you apply this cumulative update, you have to enable trace flag 8235 at a global level of the distributors.
Enabling trace flag 8235 might decrease the performance of the distribution cleanup job because the sp_MSsubscription_cleanup procedure will be called from the distribution cleanup job instead of the expired subscription cleanup job.
You can use the following TSQL command to enable trace flag 8235 at the global level:
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Learn about the terminology that Microsoft uses to describe software updates.