sync icon indicating copy to clipboard operation
sync copied to clipboard

sshfs related problem

Open bunnylushington opened this issue 11 years ago • 2 comments

I have an annoying issue when working over fuse/sshfs where (I think) sync sees that a file has changed but the contents have not yet been written to the file; a race condition of sorts. Specifically I see this error:

13:23:33.230 [info] /path/to/module.erl:1: Error: no module definition

Usually re-saving the file will trigger a successful compile. I can see one of two paths for remediation:

  • add a configurable delay between noticing the file has changed and attempting the compilation; or,
  • when this particular error is emitted, retry the compilation.

I realize that the issue is probably particular to my setup and absolutely understand if you don't want to clutter up code dealing with this; however, if one of these approaches is acceptable, I'd be happy to submit a pull request.

Thanks! And thanks a ton for sync, it's a great utility.

bunnylushington avatar Oct 10 '13 17:10 bunnylushington

Hi Kevin,

I'd be open to seeing the fix for this. A combination of the two would be ideal. When the error occurs, set a timeout of X miliseconds before sync should attempt to recompile the file, that way you at least won't cause erlang to spin rapidly trying to recompile the same file. I'd also only try to recompile it once, otherwise someone entering a typo (say forgetting to put -module at the top of their file) won't end up causing an infinite loop trying to recompile a busted file constantly.

If you did want to do a pull request for this, I'd be happy to merge it.

Thoughts?

choptastic avatar Mar 12 '14 06:03 choptastic

Hi Kevin, did you ever solve this?

choptastic avatar Oct 12 '14 04:10 choptastic