We had an issue recently where our zeo server restart. The blobs volume mounted ok but the volume with the filestorage volume didn't. This created new filestorage that were empty. Zope then proceeded to clean up the blobs that weren't referenced in database so they all got deleted.
I'm thinking there must be some kind of setting that prevents this from happening.
If there's a network problem, the open will stall and after a timeout it returns the error, and set create = 1. Meantime the network is back but create is 1. And then L286 happen:
I think a conservative fix is to remove create = 1 in L274 (and maybe L283) and also L286 is wrong because it tries to serve 2 different case (create passed as parameter to the init function and create set IN the function).
L286 should run ONLY if the parameter has explicitly passed. So use a different variable to set to 1 (ex: create_missing = 1 IN the function) in L276 and L283.
Then you can safely use os.remove(file_name) protected by create = 1 condition (and not create_missing) because you're really asking for a recreation and for create_missing you just create a file. If the network came back in the middle, create would fail and let you know the file exist so you can continue.
In general, I would remove deletion and move it explicit on an external util, so you're really sure the user want to remove it if it already exist. A further better one would just not permit deletion and let the sysadmin do it outside Zope.