<div dir="ltr">Hi all,<br><div><br></div><div>I've been experiencing some behavior using the GDAL python bindings where I am occasionally seeing what appears to be random blocks of the tiff being unwritten in geotiffs I've pushed to S3.  a small block(s) in one of the bands will be all zeros while everywhere else is good.</div><div><br></div><div>My setup is that I have a thread pool crunching through some gdal.Warp calls.  The main thread is polling for completed jobs and then uploading the file to s3.  My theory is that Python's garbage collector hasn't destroyed the dataset I've set to None before I start uploading.  Is this plausible?   The call to FlushCache didn't solve the problem for me and I'm not aware of another way via the Python bindings for ensure the dataset is closed.  I'm using Ubuntu 19.10 (comes with GDAL 2.4.2), any thoughts and ideas to try are greatly appreciated, as one can imagine, this is hard to reproduce.  </div><div><br></div><div>The code looks something like this:<br></div><div><font face="monospace"><br>def warp_tile(f_in, f_out, warp_opts):<br>    gdal_warp_opts = gdal.WarpOptions(**warp_opts, creationOptions=["TILED=YES", "COMPRESS=DEFLATE"])<br>    try:<br>        warp_ds = gdal.Warp(f_out, f_in, options=gdal_warp_opts)<br>        warp_ds.FlushCache()<br>    finally:<br>        warp_ds = None</font></div><div><br></div><div><font face="monospace"><br>with ThreadPoolExecutor(max_workers=max_workers) as executor:<br><br>    job_d = {}<br>    for job in jobs:<br>        job_d[executor.submit(warp_tile, job.in_f, job.out_f, job.warp_opts)] = out_f<br><br>    for future in as_completed(job_d):<br>        out_f = job_d[future]<br>        try:<br>            future.result()<br>        except Exception as e:<br>            ...<br>        else:<br>            boto3.resource('s3').Bucket(bucket_name).upload_file(Filename=out_f, Key=key)</font><br></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">Thanks,</font></div><div><font face="arial, sans-serif">Patrick</font></div></div>