The call to VolumeDataPageAccessor::CopyPage never returns if internet connection lost
Hello!
I'm testing the following scenario:
- (0) make sure Internet connection is available
- (1) start vdscopy-based code which copies vds from local source to online destination
- (2) turn off the Internet for a few minutes
- (3) (optional) turn on the Internet
Online destination is S3 cloud with default timeouts.
The result I get is that not-blocking (according to documentation) call VolumeDataAccessManager::CopyPage()
blocks forever, internally it waits for std::future::get
on the following lines of VolumeDataAccessManagerImpl::AddCopyPageJob
:
if (m_copyJobs[m_copyJobIndex].size() == m_requestProcessor->GetThreadPool().ThreadCount())
{
auto& otherjobs = m_copyJobs[!m_copyJobIndex];
for (auto& job : otherjobs)
{
auto error = job.second.get(); <<<< Hangs here
My call stack looks like this:
[External Code]
openvdsd.dll!OpenVDS::VolumeDataAccessManagerImpl::AddCopyPageJob(OpenVDS::VolumeDataChunk & chunk, OpenVDS::VolumeDataPageAccessorImpl & destination, OpenVDS::VolumeDataPageAccessorImpl & source) Line 710 C++
openvdsd.dll!OpenVDS::VolumeDataPageAccessorImpl::CopyPage(__int64 chunkIndex, OpenVDS::VolumeDataPageAccessor & source) Line 492 C++
MyApp.exe!`anonymous namespace'::process(seismic::IVDSCopyCallback & callback, const `anonymous-namespace'::VDSCopyInternalParams & params) Line 296 C++
MyApp.exe!seismic::VDSCopy::upload(seismic::IVDSCopyCallback & callback, const seismic::VDSCopyParams & importParams) Line 342 C++
[External Code]
No matter whether step 3 is done or not - it hangs there, execution is not restored, even if internet becomes available after few minutes of being offline.
But even if there is no internet finally - I suppose the code should just return after some reasonable timeout, storing errors inside VolumeDataAccessManagerImpl::m_uploadErrors
rather than block forever.
This behavior creates serious problems with exiting the application after the connection is lost, for example.
PS. in case of very short periods of being offline (e.g. few seconds, in my tests) call to CopyPage()
is able to recover and continue execution.