Skip to content

Don't cache FileInfo instances.#43980

Merged
1 commit merged intodotnet:masterfrom
CyrusNajmabadi:dirInfo
May 5, 2020
Merged

Don't cache FileInfo instances.#43980
1 commit merged intodotnet:masterfrom
CyrusNajmabadi:dirInfo

Conversation

@CyrusNajmabadi
Copy link
Contributor

These value don't dynamically go back to the FS to get updated info. So, for example, properties like .Exists will continue reporting the same value every time they're queried (even if the underlying may or may not be there).

This affected the nuget index in a minor way:

  1. we would see that you didn't have a nuget index (because info.Exists was false).
  2. we would download the full index.
  3. we would wait a day to update the index.
  4. we would ask "does the index exist?" and would be told "no" because of the cached value from before.
  5. we would download the full index.

THis would repeat once a day until vs was restarted. So, overall not too bad. At worst, one extra download a day. And only as long as you were in the original VS sessoin and never closed it. But still not desirable.

We now properly re-acquire the FileInfo value when starting the update process to make sure it is at least somewhat reflective of reality.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 5, 2020 18:02
@CyrusNajmabadi CyrusNajmabadi requested a review from a team May 5, 2020 18:02
@CyrusNajmabadi
Copy link
Contributor Author

Thanks!

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approval

@ghost ghost merged commit 1e8302c into dotnet:master May 5, 2020
@jinujoseph jinujoseph added this to the 16.7.P2 milestone May 6, 2020
@CyrusNajmabadi CyrusNajmabadi deleted the dirInfo branch May 20, 2020 20:56
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants