hjmangalam / parsyncfp

follow-on to parsync (parallel rsync) with better startup perf
Other
161 stars 19 forks source link

Fix the listing of all rsync PIDs on the system. Fixes #24 #25

Open Barfred opened 5 years ago

Barfred commented 5 years ago

This is a fix for issue #24.

The argument '$2' for the awk command need to be escaped as '\$2' to correctly reach the awk process (just like it's also done multiple other places in the script).

To show the problem and the result of the suggested fix, I have added a debug statement as well (feel free to cut that out if you like). This debug statement says:

Before the fix was applied: DEBUG: PIDs of all rsync procs on the system: efam-da+ 28824 0.4 0.0 27972 9592 ? Ss 12:31 0:00 perl /home/mb/git/parsyncfp/parsyncfp -NP=3 --rsyncopts=--partial -v --info=BACKUP,FLIST0,STATS0 --maxbw=19200 --chunksize=2G --debug --verbose=2 --nowait --startdir=/home/mb/data . serv2:/tmp/dest jph 17682 0.0 0.0 23556 2932 ? Ss Jun17 0:00 rsync --server -vulogDtprze.iLsfx . /home/jph/data/ jph 17683 0.1 0.0 23816 1688 ? S Jun17 1:54 rsync --server -vulogDtprze.iLsfx . /home/jph/data2/ miba 25650 0.0 0.0 53940 8584 pts/0 S+ 12:29 0:00 vi parsyncfp/parsyncfp root 10517 44.3 0.1 209784 141996 ? R Jun17 469:24 /usr/bin/rsync --daemon --no-detach root 13644 0.0 0.0 4504 736 ? S 12:18 0:00 sh -c timeout 86400 rsync -avz -y --delete-during --stats --numeric-ids --partial serv3:/tmp/tmp_rsync/ /tmp/data3/ 2>&1 | tee /tmp/rsync-FQdta root 13645 0.0 0.0 11556 828 ? S 12:18 0:00 timeout 86400 rsync -avz -y --delete-during --stats --numeric-ids --partial serv3:/tmp_rsync3/ /tmp/data4/ root 13646 0.0 0.0 7296 668 ? S 12:18 0:00 tee /tmp/virtual_envs-live-rsync-gazelle-live_rsync-FQdta

After the fix was applied: DEBUG: PIDs of all rsync procs on the system: 820 1947 1949 1958 1960 1969 1971 10517 13644 13645 13646 13647 13696 17682 17683 27954 31608

hjmangalam commented 5 years ago

Forgot to add - I've set a debug function to insert lines (LINE) so have converted your debug suggestion to a debug() call.

Also, added a logfile that tracks suspended PIDs and UNsuspended PIDs to make sure that they track correctly. Will keep this for the next few releases in case someone else finds such an incedent.

hjm

On Tuesday, June 18, 2019 1:15:07 PM PDT Mikael Barfred wrote:

This is a fix for issue #24.

The argument '$2' for the awk command need to be escaped as '\$2' to correctly reach the awk process (just like it's also done multiple other places in the script).

To show the problem and the result of the suggested fix, I have added a debug statement as well (feel free to cut that out if you like). This debug statement says:

Before the fix was applied: DEBUG: PIDs of all rsync procs on the system: efam-da+ 28824 0.4 0.0 27972 9592 ? Ss 12:31 0:00 perl /home/mb/git/parsyncfp/parsyncfp -NP=3 --rsyncopts=--partial -v --info=BACKUP,FLIST0,STATS0 --maxbw=19200 --chunksize=2G --debug --verbose=2 --nowait --startdir=/home/mb/data . serv2:/tmp/dest jph 17682 0.0 0.0 23556 2932 ? Ss Jun17 0:00 rsync --server -vulogDtprze.iLsfx . /home/jph/data/ jph 17683 0.1 0.0 23816 1688 ? S Jun17 1:54 rsync --server -vulogDtprze.iLsfx . /home/jph/data2/ miba 25650 0.0 0.0 53940 8584 pts/0 S+ 12:29 0:00 vi parsyncfp/parsyncfp root 10517 44.3 0.1 209784 141996 ? R Jun17 469:24 /usr/bin/rsync --daemon --no-detach root 13644 0.0 0.0 4504 736 ? S 12:18 0:00 sh -c timeout 86400 rsync -avz -y --delete-during --stats --numeric-ids --partial serv3:/tmp/tmp_rsync/ /tmp/data3/ 2>&1 | tee /tmp/rsync-FQdta root 13645 0.0 0.0 11556 828 ? S 12:18 0:00 timeout 86400 rsync -avz -y --delete-during --stats --numeric-ids --partial serv3:/tmp_rsync3/ /tmp/data4/ root 13646 0.0 0.0 7296 668 ? S 12:18 0:00 tee /tmp/virtual_envs-live-rsync-gazelle-live_rsync-FQdta

After the fix was applied: DEBUG: PIDs of all rsync procs on the system: 820 1947 1949 1958 1960 1969 1971 10517 13644 13645 13646 13647 13696 17682 17683 27954 31608 You can view, comment on, or merge this pull request online at:

https://github.com/hjmangalam/parsyncfp/pull/25

-- Commit Summary --

  • Add a DEBUG statement to show all rsync PIDs
  • Fix the listing of all rsync PIDs on the system

-- File Changes --

M parsyncfp (3)

-- Patch Links --

https://github.com/hjmangalam/parsyncfp/pull/25.patch https://github.com/hjmangalam/parsyncfp/pull/25.diff

Harry Mangalam, Info[1]


[1] http://moo.nac.uci.edu/~hjm/hjm.sig.html