Collector fails due to blocked files, propose simple fix
See original GitHub issueHi Everyone, I realize that a similar issue has been discussed recently, but I have some substantiated evidence about what exactly happens. In my case McAfee Adaptive Thread Protection (yikes) is blocking the instrumented modules, so that InstrumentationHelper.RestoreOriginalModule()
fails to restore the original file even after the default 12 retries with increasing sleep intervals of 6, 12, 24, … milliseconds.
For me, it is really sufficient to increase that interval by modifing the default initialSleepSeconds
(which is actually misnamed, as the number is interpreted as milliseconds) of InstrumentationHelper.CreateRetryStrategy()
from 6 to a somewhat larger value of 50. Alternatively increasing the number of retries from 12 to 15 or something along these lines also fixes it for me.
It would be great if either of those values would be configurable, either by a config file, command line argument or MSBuild parameter.
I would do the neccessary changes myself if someone more familiar with coverlet could give me a hint about what would be the appropriate method for injecting this parameter/configuration into the InstrumentationHelper
.
Edit: I realized I talked about having evidence but did not include it here. I used Sysinternals Process Monitor to see when dotnet.exe, testhost.exe and mfeatp.exe (McAfee) open and close the files, and this is exactly what I saw: dotnet.exe failing to open the file for writing, because mfeatp.exe has this file still open and allows only read only sharing. As soon as mfeatp.exe closes the file, dotnet.exe succeeds in opening the file for writing.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
Understood you point…fair, I need to think a bit more about(the update is a bit more complex we need to add it to all drivers not only collectors and update guide, I’m bit reclutant on adding new parameters, but this time could be a solution), add param could work.
Closing for now, we’ll re-open if others will hit this issue, no more thumbs up here.