Scripts ran without sync conflicts for the past 8 hours. That’s a fantastic improvement.
I noticed uptime for syncthing was only 4h 9m.
Checked the stderr log:
panic(0x681be0, 0xc8225da9b0)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/syncthing/syncthing/lib/scanner.hashFiles(0xc8201ef890, 0x2a, 0x20000, 0xc82162e120, 0xc820503560, 0x1077450, 0xc821cf2b80, 0xc82162e060)
/home/buildslave/workspace/syncthing-pr/src/github.com/syncthing/syncthing/lib/scanner/blockqueue.go:101 +0x87b
github.com/syncthing/syncthing/lib/scanner.newParallelHasher.func1(0xc8201ef890, 0x2a, 0x20000, 0xc82162e120, 0xc820503560, 0x1077450, 0xc821cf2b80, 0xc82162e060, 0x1077478, 0xc8225da6c0)
/home/buildslave/workspace/syncthing-pr/src/github.com/syncthing/syncthing/lib/scanner/blockqueue.go:28 +0x6a
created by github.com/syncthing/syncthing/lib/scanner.newParallelHasher
/home/buildslave/workspace/syncthing-pr/src/github.com/syncthing/syncthing/lib/scanner/blockqueue.go:30 +0x16e
Checked stdout:
....
[KI3N7] 23:53:10 INFO: Completed initial scan (rw) of folder minime-temp
[KI3N7] 02:38:50 INFO: File{Name:"syncthingcheck/myfile3", Type:FILE, LocalVersion:0, Permissions:0644, Modified:1469497130, Version:{[{KI3N7UU 99}]}, Length:0, Deleted:false, Invalid:false, NoPermissions:false, Blocks:[Block{0/131072/eb48336b432608a8a9428adadc609967b554b7604d856a3f3505f8e1a509b18a} Block{131072/131072/2d8bda01d8da8938da26aee58d1dc0c245c5c48e7b29e7f734c5e0e5980fb2d3} Block{262144/131072/e228cb92df96761ce6c90326be4f4f5277bee8cc372463a3fdb31d14e01369db} Block{393216/131072/0e4e7ea99f88a356d4de91da1c3ec625fb4a33d329c5a7255cea5f8bf825d298} Block{524288/22264/ad0c34ce516e27b84284cc1ceaea71e22719fbe3f9481c0a043e70116a405c31}]}
[KI3N7] 02:38:51 INFO: syncthing v0.14.0+9-g77da5fc "Dysprosium Dragonfly" (go1.6.3 darwin-amd64) unknown-user@lx-buildslave.syncthing.net 2016-07-25 20:16:59 UTC
....
The script generating myfile3 is basically the same as my first script (with all instances of myfile changed to myfile3 and the following at the bottom of the loop:
if [ $RANDOM -gt 32762 ]; then
echo Truncating
tail -n $RANDOM myfile3 > myfile3.tmp
rm myfile3
mv myfile3.tmp myfile3
fi
done
So both the scripts that just add seem fine, the one with a truncation step occasionally caused the panic.