зеркало из https://github.com/microsoft/BuildXL.git
Merged PR 794980: Log more information when bxl failed to open a file for hashing
Log sharing violation and timeout separately Log current bxl pid when we find a bxl process holds a handle
This commit is contained in:
Родитель
50a1c536d4
Коммит
cd302cb597
|
@ -454,7 +454,7 @@ namespace BuildXL.Engine.Cache.Artifacts
|
|||
if (openResult.Status == OpenFileStatus.Timeout ||
|
||||
openResult.Status == OpenFileStatus.SharingViolation)
|
||||
{
|
||||
Tracing.Logger.Log.TimeoutOpeningFileForHashing(m_loggingContext, expandedPath);
|
||||
Tracing.Logger.Log.OpeningFileFailedForHashing(m_loggingContext, expandedPath, openResult.Status.ToString());
|
||||
return false; // returning "not done", i.e., do retry
|
||||
}
|
||||
else
|
||||
|
|
|
@ -69,13 +69,14 @@ namespace BuildXL.Engine.Cache.Tracing
|
|||
public abstract void FailedOpenHandleToGetKnownHashDuringMaterialization(LoggingContext context, string path, string message);
|
||||
|
||||
[GeneratedEvent(
|
||||
(int)LogEventId.TimeoutOpeningFileForHashing,
|
||||
(int)LogEventId.OpeningFileFailedForHashing,
|
||||
EventGenerators = EventGenerators.LocalOnly,
|
||||
EventLevel = Level.Verbose,
|
||||
Keywords = (int)Keywords.UserMessage,
|
||||
EventTask = (int)Tasks.Storage,
|
||||
Message = "The path '{0}' could not be opened for hashing because the filesystem returned ERROR_TIMEOUT.")]
|
||||
public abstract void TimeoutOpeningFileForHashing(LoggingContext context, string path);
|
||||
Message = "The path '{0}' could not be opened for hashing because the filesystem returned {error}.")]
|
||||
public abstract void OpeningFileFailedForHashing(LoggingContext context, string path, string error);
|
||||
|
||||
|
||||
[GeneratedEvent(
|
||||
(int)LogEventId.HashedReparsePointAsTargetPath,
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace BuildXL.Engine.Cache.Tracing
|
|||
|
||||
RetryOnLoadingAndDeserializingMetadata = 746,
|
||||
|
||||
TimeoutOpeningFileForHashing = 748,
|
||||
OpeningFileFailedForHashing = 748,
|
||||
|
||||
TemporalCacheEntryTrace = 2733,
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace BuildXL.Native.IO.Windows
|
|||
|
||||
private static readonly SecurityIdentifier s_worldSid = new SecurityIdentifier(WellKnownSidType.WorldSid, null);
|
||||
|
||||
private static readonly int s_currentBxlPid = Process.GetCurrentProcess().Id;
|
||||
|
||||
/// <inheritdoc />
|
||||
public PosixDeleteMode PosixDeleteMode { get; set; }
|
||||
|
||||
|
@ -2112,6 +2114,10 @@ namespace BuildXL.Native.IO.Windows
|
|||
Process process = Process.GetProcessById(pid);
|
||||
|
||||
builder.AppendFormat("Handle was used by '{0}' with PID '{1}'.", process.ProcessName, pid);
|
||||
if (process.ProcessName.Equals("bxl"))
|
||||
{
|
||||
builder.AppendFormat(" bxl is holding the handle. Current bxl process PID is {0}.", s_currentBxlPid);
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
Загрузка…
Ссылка в новой задаче