EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Error feedback to OS during write

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#35405
Posted: 01/06/2016 10:10:53
by Danil Kornishev (Basic support level)
Joined: 05/05/2015
Posts: 4

I am trying to implement an error handling case during writing a large file. it seems that (due to memory-mapped nature?) of writes, errors from callbacks do not trigger windows-level errors (well actually error does trigger but maybe 1/20).

I was wondering if there is a way to notify cbfs that the ongoing file write should be stopped and error presented to the user? I tried turning file cache when error occurred before throwing CBFSError, but it didn't seem to help.

Is turning off caching the only option, or is there something else I can try?
#35406
Posted: 01/06/2016 10:18:38
by Eugene Mayevski (EldoS Corp.)

Most often the data first get to the cache, and only later flushed to the disk (and you have a callback to handle). This is why it seems that errors don't get back to the OS. They do (and you will get a message in the OS saying that the delayed write has failed). But indeed, only turning off caching would ensure that you get the write request immediately and can return the error immediately as well.


Sincerely yours
Eugene Mayevski
#35407
Posted: 01/06/2016 10:27:48
by Danil Kornishev (Basic support level)
Joined: 05/05/2015
Posts: 4

Thanks for the quick reply.

What I am seeing is that even if I put
Code
throw new ECBFSError(errorCodeToThrow)


as the first line in the onWriteFile, files in the explorer appear to finish writing correctly (no error is presented).

It would be perfectly acceptable for an error to be presented after it actually occurs (such is the nature of async/cached system), but I am seeing no failure at all (well, ~1/20 cases error does pop up in windows).
#35477
Posted: 01/09/2016 09:30:17
by Eugene Mayevski (EldoS Corp.)

I apologize for the delay in answering.

Actual writing can occur long after Explorer has finished the operation. The data will stay in OS cache for some time.

The error is reported to and handled by the cache manager. Usually it shows a small message in system notification area, something like "delayed write failed".

Turning off the system cache for your CBFS disk and/or using a mounting point of "Network" type should help (am not exactly sure about Network type though).


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 2049 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!