You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At my company we have been using save_cog_with_dask very heavily to produce COGs from very large rasters. For certain raster/chunk combinations we have observed the function failing with an AssertionError. I did some digging and isolated the problem to the following code:
It seems that for certain combinations of raster dimensions and chunking scheme, a situation can arise in which self.write_credits is 0 but the write has not completed. The following code below should reproduce the problem:
The dimensions in this example were chosen because they match the dimensions of an actual raster for which this problem arose with this specific chunking. Using the time-honored method of distributed.print-based debugging, I isolated the error to the line that checks for self.write_credits < 1. Playing around with the source, I noticed that changing this line to
ifself.write_credits<1andnotself.final
makes the error go away and nothing else seems to break, but I don't know if that's the right decision or not.
The text was updated successfully, but these errors were encountered:
From what I can tell that's basically the same thing as what I did, right? Happy to make a PR for this if it would help.
edit: would it make more sense to move the if self.final check to the top of can_flush so that condition gets evaluated first? Or is there a scenario where that could cause problems?
My concern is that I still don’t understand if the assert is overly aggressive or if there is an actual logic error, for example it could be triggered by certain rare Dask events, like work stealing behaviour of the scheduler.
in general mpu code needs another pass of simplification, now that we know it works most of the time
At my company we have been using
save_cog_with_dask
very heavily to produce COGs from very large rasters. For certain raster/chunk combinations we have observed the function failing with anAssertionError
. I did some digging and isolated the problem to the following code:It seems that for certain combinations of raster dimensions and chunking scheme, a situation can arise in which
self.write_credits
is0
but the write has not completed. The following code below should reproduce the problem:The dimensions in this example were chosen because they match the dimensions of an actual raster for which this problem arose with this specific chunking. Using the time-honored method of
distributed.print
-based debugging, I isolated the error to the line that checks forself.write_credits < 1
. Playing around with the source, I noticed that changing this line tomakes the error go away and nothing else seems to break, but I don't know if that's the right decision or not.
The text was updated successfully, but these errors were encountered: