Alternative FTP failure?

(I’ve created a WIP PR in place for DEV discussion and at least a workaround, if not a permanent fix; PR3866)

I need assistance from other devs on this.

I can only replicate the problem when not in debug mode. This is AFTP against a local FileZillaServer.

So far I’ve tracked it to line 30 in BlockVolumeWriter.cs and m_compression will be null when the failure occurs.

The path of the code is that SpillCollectorProcess.cs line 116 will call AddBlock() in BlockVolumeWriter.cs and the m_compression will be null.

When run in debug mode or I place a 3 second delay on after the aftp PutAsync upload, then m_compression will not be null when/if the AddBlock() method gets called, depending on the spill.

p.s. I’m still trying to understand the whole ‘spill’ thing going on. If anyone is able to explain it I’d appreciate it.

Secondly, and maybe just as important a clue, before getting to the issue above I first was hitting an exception with a temp file missing. In TempFile.cs I commented out the .Delete(m_path); down in the Dispose and I was able to get to the exception outlined above. so there seems to be an issue with the temp files getting removed too early… possibly these issues are both realted to something ending too early and releasing an object(s).