提交 5c989919 编写于 作者: H heejaechang

rolling back changeset # 1401724 to see whether this is the one caused VM regression.

"When a file is replaced on disk its timestamp should be set to the most recent of its creation time and last write time. Also updating FileKey to use last-write-time, since that's what it's comment explicitly calls for." (changeset 1408149)
上级 747d1a15
......@@ -34,7 +34,7 @@ public FileKey(string fullPath, DateTime timestamp)
/// <exception cref="IOException"/>
public static FileKey Create(string fullPath)
{
return new FileKey(fullPath, FileUtilities.GetLastWriteTimeStamp(fullPath));
return new FileKey(fullPath, FileUtilities.GetFileTimeStamp(fullPath));
}
public override int GetHashCode()
......
......@@ -382,33 +382,13 @@ internal static void DeleteFileOnClose(string fullPath)
}
}
/// <exception cref="IOException"/>
internal static DateTime GetLastWriteTimeStamp(string fullPath)
{
Debug.Assert(PathUtilities.IsAbsolute(fullPath));
try
{
return File.GetLastWriteTimeUtc(fullPath);
}
catch (Exception e)
{
throw new IOException(e.Message);
}
}
/// <exception cref="IOException"/>
internal static DateTime GetFileTimeStamp(string fullPath)
{
Debug.Assert(PathUtilities.IsAbsolute(fullPath));
try
{
// In the case where a file is copied from one directory to the other, the last write time will stay
// the same but the creation time will get updated. Return the most recent of the two times so that
// our caches don't run into a scenario where and older file was copied over an existing one and the
// cache thinks everything is up-to-date, when in fact we need to reparse the file.
var lastWriteTime = File.GetLastWriteTimeUtc(fullPath);
var creationTime = File.GetCreationTimeUtc(fullPath);
return creationTime > lastWriteTime ? creationTime : lastWriteTime;
return File.GetLastWriteTimeUtc(fullPath);
}
catch (Exception e)
{
......
......@@ -357,7 +357,7 @@ private MetadataShadowCopy GetMetadataShadowCopyNoCheck(string fullPath, Metadat
bool fault = true;
try
{
key = new FileKey(fullPath, FileUtilities.GetLastWriteTimeStamp(newCopy.Public.PrimaryModule.FullPath));
key = new FileKey(fullPath, FileUtilities.GetFileTimeStamp(newCopy.Public.PrimaryModule.FullPath));
fault = false;
}
finally
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册