Problem description: on ours SQL Server 2008, when we execute "EXECUTE msdb.[dbo].[sp_cycle_agent_errorlog] ", we got the error message below:
Msg 22022, Level 16, State 1, Line 0
SQLServerAgent Error: 32.
Step1: We can see that the log is recycled. The file SQLAGENT.OUT contains for each execution the message below:
 Errorlog has been reinitialized. See previous log for older entries.
Step2: Inside the procmon, we can see a SHARING VIOLATION
Event Class: File System
Step3: With process explorer, I didn’t see that another process owns the same file SQLAGENT.OUT
Cause: After investigation, we can see that SQLAgent.exe is locked by himself. If you run Handle you will see that 2 handle are opened. And it should be only one. It look like a handle leak.
C:>handle.exe -a sqlagent.out
SQLAGENT.EXE pid: 13196 type: File FA4: H:MSSQL10.MSSQLSERVER
C:>tasklist |findstr 13196
Current workaround: Restart SQL Agent service on server.
NB : currently I am investigating my colleague from Microsoft Support (3rd December 2013)
Michel Degremont | Xbox Live Music - Data Engineer - SQL Server & PDW |