comment
authorJoey Hess <joeyh@joeyh.name>
Thu, 20 Feb 2020 18:45:12 +0000 (14:45 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 20 Feb 2020 18:45:12 +0000 (14:45 -0400)
doc/todo/more_extensive_retries_to_mask_transient_failures/comment_9_4fe7beb47e88259a72a1cd42c85761a5._comment [new file with mode: 0644]

diff --git a/doc/todo/more_extensive_retries_to_mask_transient_failures/comment_9_4fe7beb47e88259a72a1cd42c85761a5._comment b/doc/todo/more_extensive_retries_to_mask_transient_failures/comment_9_4fe7beb47e88259a72a1cd42c85761a5._comment
new file mode 100644 (file)
index 0000000..8df1b98
--- /dev/null
@@ -0,0 +1,22 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 9"""
+ date="2020-02-20T18:31:59Z"
+ content="""
+Hmm, the reason I'm not worried about leaking open FDs
+when killing threads is because `bracket` is generally used 
+when opening files, with a cleanup action that closes them.
+(when not doing lazy IO and letting the GC close the file once the value
+goes out of scope). So when a thread is canceled, the cleanup actions
+automatically run.
+
+So what's needed is a way to use `bracket` for the non-interactive,
+non-pooled processes.
+
+Currently processes are run by things like `safeSystem`
+and `readProcess`, neither of which use a bracketing operation.
+But they could use a bracketOnError with an cleanup action that
+is passed the pid and kill -9's it.
+
+That avoids the registration and the child thread problem.
+"""]]