dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.2k stars 661 forks source link

WhatTryResetTimeoutShouldReturn flag usage #914

Closed susarlanikhilesh closed 4 years ago

susarlanikhilesh commented 4 years ago

Feature request can skip this form. Bug report must complete it. Check List must be 100% match or it will be automatically closed without further discussion. Please remove this line.

Environment

Check List

Description

What is the default value of the flag WhatTryResetTimeoutShouldReturn and how do we use it in the mirror example. When working with slow disks or i/o time outs, how can we set this flag to true, so that it can have an extended i/o.

Logs

Please attach in separate files: mirror output, library logs and kernel logs. In case of BSOD, please attach minidump or dump analyze output.

Liryna commented 4 years ago

@susarlanikhilesh Hi!

There is no such flag. If you are talking about the reset timeout, you need to call it before the request reach the timeout value set at mount time or the default value.

susarlanikhilesh commented 4 years ago

The timeout parameter in the mount argument. The default value is around 20 secs right ?

Liryna commented 4 years ago

@susarlanikhilesh It is 15 seconds https://github.com/dokan-dev/dokany/blob/6ae6188e61df3f7a1448591a3675c130c4d22bc7/sys/dokan.h#L126

I updated the documentation https://github.com/dokan-dev/dokany/commit/0a7f726434b82637c3bda27dfcdc822b3a5f9fee

Can this issue be closed ?

susarlanikhilesh commented 4 years ago

Can you please provide any sample code snippet for calling the TryResetTimeout function?

If (IO operation happening for more than 10 secs) then call dokany TryResetTimeout function

Liryna commented 4 years ago

There is no TryResetTimeout but DokanResetTimeout. Are you related to @TrabacchinLuigi ? https://github.com/dokan-dev/dokany/blob/0a7f726434b82637c3bda27dfcdc822b3a5f9fee/dokan/dokan.h#L825

Code snippet would be pretty hard to provide here as it would depend what is your IO and how you can track it. I would imagine to have a timer at the start of the IOs you expect to take time and schedule an async call that would be trigger before the timeout to call DokanResetTimeout

susarlanikhilesh commented 4 years ago

Yes. So, I'm going to have my IO in an async call, where say I would wait for 10 seconds and see if I got any response. If it didn't then I want to extend my timer using the TryResetTimeout/DokanResetTimeout.

Liryna commented 4 years ago

Sounds good! Let me know if you have further questions and I will reopen the ticket.