1) First, remove any outstanding publishing jobs (outstanding publishing jobs = jobs that are not failed or success) still in the publishing queue. This is so that in subsequent steps, we will be cleaning out some files in the filesystem and we can be sure not delete files that are tied to outstanding jobs. See KB article for details regarding,
In SDL Web, how to cleanup files left over by publishing2) On the Content Manager side (or publisher side), delete any *.xml files still seen in the 'Transactions' and 'Temp' folder.
%Tridion_Home%\bin\TransactionsBy default, Temp folder is in
C:\Temp. Just clear out any fiiles start with tcm*.*
On the deployer side, delete any files still remain in the "incoming folder"
3) Run the below T-SQL command against the broker database
EXEC SP_UPDATESTATS
ALTER DATABASE <Tridion_Broker> SET ALLOW_SNAPSHOT_ISOLATION ON
ALTER DATABASE <Tridion_Broker> SET READ_COMMITTED_SNAPSHOT ON
4) Check the StateStore db and broker db, if the below index is missing, add it. If index is already there, no further action here.
CREATE INDEX IDX_EXECUTION_PROPERTY_FK ON EXECUTION_PROPERTY (EXECUTION_ID, PIPELINE_ID, STEP_ID) WITH FILLFACTOR = 80
5) Apply CD Hotfix CD_8.5.0.5099.zip. To receive the hotfix, see KB article
Where can I find hotfixes for SDL Tridion/Web?6) That's it. The above steps should help to avoid "deadlocked" error.