html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/pull/4879#issuecomment-775489828,https://api.github.com/repos/pydata/xarray/issues/4879,775489828,MDEyOklzc3VlQ29tbWVudDc3NTQ4OTgyOA==,488992,2021-02-08T21:56:21Z,2021-02-08T21:56:21Z,CONTRIBUTOR,"As my colleague @huard suggested, I have written an additional test which demonstrates the problem (essentially the same idea I proposed in my initial [issue](https://github.com/pydata/xarray/issues/4862)): https://github.com/pydata/xarray/compare/master...cjauvin:add-netcdf-refresh-test As I explained in the issue I have a potential fix for the problem: https://github.com/pydata/xarray/compare/master...cjauvin:netcdf-caching-bug but the problem is that it feels a bit weird to have to that, so I suspect that there's a better way to solve it.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,803068773 https://github.com/pydata/xarray/pull/4879#issuecomment-774781361,https://api.github.com/repos/pydata/xarray/issues/4879,774781361,MDEyOklzc3VlQ29tbWVudDc3NDc4MTM2MQ==,488992,2021-02-07T22:40:44Z,2021-02-07T22:42:11Z,CONTRIBUTOR,"Thank you for the feedback! I quickly tested your suggested fix against the script I refered to in my original issue, and it's still behaving the same if I'm not mistaken. I looked very quickly so perhaps I'm wrong, but what I seem to understand is that your fix is similar to an idea my colleague @huard had, which was to make the cached item more granular by adding a call to `Path(..).stat()` in the cache key tuple (the idea being that if the file has changed on disk between the two open calls, this will detect it). It doesn't work because (I think) it doesn't change the fact that the underlying netcdf file is never explicitly close, that is, this line is never called: https://github.com/pydata/xarray/blob/a5f53e203c52a7605d5db799864046471115d04f/xarray/backends/file_manager.py#L222 Sorry in advance if something in my analysis is wrong, which is very likely!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,803068773