Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netCDF (multidim): workaround crash with using same file in 2 differents threads (each thread with its own dataset object) (fixes #6253) #6311

Merged
merged 3 commits into from
Sep 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
netcdf_multidim.py: test opening same file twice
  • Loading branch information
rouault committed Sep 3, 2022
commit 39cdd1423bd613f8240b674f4cf95486e11576ea
16 changes: 16 additions & 0 deletions autotest/gdrivers/netcdf_multidim.py
Original file line number Diff line number Diff line change
@@ -2613,3 +2613,19 @@ def create():
assert delay < 1

gdal.Unlink("tmp/test_netcdf_multidim_read_transposed_bigger_file.nc")


def test_netcdf_multidim_var_alldatatypes_opened_twice():
"""Test https://github.com/OSGeo/gdal/pull/6311"""

ds1 = gdal.OpenEx("data/netcdf/alldatatypes.nc", gdal.OF_MULTIDIM_RASTER)
assert ds1
rg1 = ds1.GetRootGroup()
assert rg1
assert rg1.OpenMDArray("string_var") is not None

ds2 = gdal.OpenEx("data/netcdf/alldatatypes.nc", gdal.OF_MULTIDIM_RASTER)
assert ds2
rg2 = ds2.GetRootGroup()
assert rg2
assert rg2.OpenMDArray("string_var") is not None