feat(bkgpslog):Force ordered write operations with wait
[EVA-2020-02.git] / exec / bkgpslog-plan.org
index bc98f9ae67d56901c1c41d5a8429d0bfd5805ec1..7eb5514b65bff95a140749317af2638c65313261 100644 (file)
@@ -1,3 +1,21 @@
+* bkgpslog task list
+** DONE Add job control for short buffer length
+   CLOSED: [2020-07-02 Thu 16:04]
+2020-07-02T14:56Z; bktei> File write operations were bundled into a
+magicWriteBuffer function that is called then detached from the script
+shell (job control), but the detached job is not tracked by the main
+script. A problem may arise if two instances of magicWriteBuffer
+attempt to write to the same tar simultaneously. Two instances of
+magicWriteBuffer may exist if the buffer length is low (ex: 1 second);
+the default buffer length of 60 seconds should reduce the probability
+of a collision but it should be possible for the main script to track
+the process ID of a magicWriteBuffer() as soon as it detaches and then
+checking (via ~$!~ as described [[https://bashitout.com/2013/05/18/Ampersands-on-the-command-line.html][here]]) that the process is still alive.
+2020-07-02T15:23Z; bktei> I found that the Bash ~wait~ built-in can be
+used to delay processing until a specified job completes. The ~wait~
+command will pause script execution until all backgrounded processes
+complete.
+2020-07-02T16:03Z; bktei> Added ~wait~.
 * bkgpslog narrative
 ** Initialize environment
 *** Init variables