home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 445502216

This data as json

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/issues/2560#issuecomment-445502216 https://api.github.com/repos/pydata/xarray/issues/2560 445502216 MDEyOklzc3VlQ29tbWVudDQ0NTUwMjIxNg== 1217238 2018-12-09T01:06:26Z 2018-12-09T01:06:26Z MEMBER

OK, I think I understand what's going on here and why this issue only appears with xarray v0.11.

The problem is related to how you are opening files with xarray but not closing them: https://github.com/limix/limix/blob/8bc0861035cc60b3ce7bcbf7f147bcc828580828/limix/qtl/test/test_qtl_xarr.py#L20

With v0.11, xarray introduced a least-recently-used cache for netCDF files. This means xarray's LRUCache is holding on to a reference to your files, so they never get garbage collected, and automatically closed by netCDF4-Python. Hence the HDF5 locks never get released.

Although it is indeed a good practice to always explicitly close files, I think we should explore using weak references to keep track of files in our cache so we don't hold on to them for holding than necessary.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  383057458
Powered by Datasette · Queries took 83.146ms · About: xarray-datasette