Assert when trying to make slice on connection lost
We catch assertion in OpenVDS in base scenario with remote (S3) requests + lost internet conenction case:
P1. Open handle to remote S3 and make N requests:
std::vector<std::array<float, OpenVDS::Dimensionality_Max>> samplesPositions;
// Generate required points for small area
// And fetch via RequestVolumeSamples
auto vdsRequest(accessManager.RequestVolumeSamples(
OpenVDS::Dimensions_012,
0,
channelIndex,
reinterpret_cast<const float(*)[OpenVDS::Dimensionality_Max]>(samplesPositions.data()),
static_cast<int>(samplesPositions.size()),
OpenVDS::InterpolationMethod::Linear));
P2. Wrap P1 as std::future list:
std::vector<std::future<std::shared_ptr<VolumeDataRequestFloat>>> requests;
for (std::size_t t(0); t < 100; t++)
{
requests.emplace_back(std::async(makeRequest(t));
}
P3. Disconnect ethernet cable or turn off wifi connection
Expression: m_pendingDownloadRequests.find(chunk) == m_pendingDownloadRequests.end()
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)
---------------------------
Abort Retry Ignore
---------------------------
Looks like library should check chunk existage before access:
bool VolumeDataStoreIOManager::PrepareReadChunkImpl(const VolumeDataChunk &chunk, int adaptiveLevel, Error &error)
{
...
// HERE
if (m_pendingDownloadRequests.find(chunk) == m_pendingDownloadRequests.end())
return false
/// Continue
std::string url = CreateUrlForChunk(layerName, chunk.index);
auto transferHandler = std::make_shared<ReadChunkTransfer>(compressionInfo, (metadataManager != nullptr) ? parsedMetadata.CreateChunkMetadata() : std::vector<uint8_t>());
if (isConstantValue)
{
m_pendingDownloadRequests[chunk] = PendingDownloadRequest(transferHandler);
}
else
{
m_pendingDownloadRequests[chunk] = PendingDownloadRequest(m_ioManager->ReadObject(url, transferHandler, ioRange), transferHandler);
}
return true;
}