antirek / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 1 forks source link

maxDelays doesn't seem to work #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set maxDelays to 1
2. Start lsyncd
3. Save a file

What is the expected behavior? What does Lsyncd do instead?
It should sync instantly, but it takes 10 seconds+ to do the sync.

What version of Lsyncd are you using? On what operating system (host and
target(s)?
Ubuntu, lsyncd 2.0.4

Verbose logfile, my conf, and a sh script I use to start it attached.

Original issue reported on code.google.com by aagaa...@gmail.com on 15 Sep 2011 at 8:00

Attachments:

GoogleCodeExporter commented 9 years ago
It will flush the delay queue when maxDelays is overflowed instead of reached. 
Two uncollapseable events (that is another file) should be followed an 
immediate call of rsync

Anyway when you want immediate action you should set the delay time to 0.  
'delay = 0' (Or at least 1 second so the usual tripple call for creating a new 
file (CREATE, ATTRIB; CLOSE_WRITE) does not result into 3 calls of rsync.

Original comment by axk...@gmail.com on 15 Sep 2011 at 12:30

GoogleCodeExporter commented 9 years ago
If you see lsync.sh I do set delay to 1 second. But I still get a 10+ second 
delay before the sync is executed.

Original comment by aagaa...@gmail.com on 16 Sep 2011 at 6:11

GoogleCodeExporter commented 9 years ago
from the logs it seems you run into the limit you set by maxProcesses. Lsyncd 
will not span more than maxProcesses and anymore will be delayed.

Otherwise there are a few things wrong with your configuration

The sync{} command should not be part of "settings".
Please do not add --delete in rsyncOpts as Lsyncd will intelligently add it to 
those commands where necessary. Same thing with recursive (-r) which is implied 
by -a. 

Original comment by axk...@gmail.com on 16 Sep 2011 at 10:11

GoogleCodeExporter commented 9 years ago
Success!

Thank you, and sorry about the user error. You might wanna update the manual 
with some more examples. For example the top "settings" example could include 
1-2 sync examples too.

Seems there was mostly examples for advanced behaviour. And since sync in 
settings worked, I didn't think of that as being bad syntax.

Thanks again. Except from this little problem I'm loving 2.0 so far :)

Original comment by aagaa...@gmail.com on 16 Sep 2011 at 10:59

GoogleCodeExporter commented 9 years ago
Please post me some example to include.

Original comment by axk...@gmail.com on 16 Sep 2011 at 11:16

GoogleCodeExporter commented 9 years ago
I think if you modify the top settings file example:
settings = {
   logfile    = "/tmp/lsyncd.log",
   statusFile = "/tmp/lsyncd.status",
   nodaemon   = true,
}
And add these under it:
sync{default.rsync, source="DIRNAME", target="DIRNAME"}
sync{default.rsync, source="/home/user/src/", target="foohost.com:~/trg/"}

That would be easier for a user to copy&paste and then modify, than picking 
examples from multiple places.

In addition I think the default.rsync examples should include your note about 
not including --delete in rsyncOpts.

Original comment by aagaa...@gmail.com on 16 Sep 2011 at 11:21