[前][次][番号順一覧][スレッド一覧]

ruby-changes:72830

From: Ivo <ko1@a...>
Date: Fri, 5 Aug 2022 18:41:09 +0900 (JST)
Subject: [ruby-changes:72830] 74817f3d37 (master): [DOC] Process._fork does not get called by Process.daemon

https://git.ruby-lang.org/ruby.git/commit/?id=74817f3d37

From 74817f3d37bb7153385f682f75e37713c4c8009d Mon Sep 17 00:00:00 2001
From: Ivo Anjo <ivo.anjo@d...>
Date: Fri, 5 Aug 2022 10:40:48 +0100
Subject: [DOC] Process._fork does not get called by Process.daemon

As discussed in [Bug #18911], I'm adding some documentation to
`Process._fork` to clarify that it is not expected to cover
calls to `Process.daemon`.

[Bug #18911]: https://bugs.ruby-lang.org/issues/18911

Co-authored-by: Yusuke Endoh <mame@r...>
---
 process.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/process.c b/process.c
index 5d16a3854a..fb31418e00 100644
--- a/process.c
+++ b/process.c
@@ -4353,6 +4353,13 @@ rb_call_proc__fork(void) https://github.com/ruby/ruby/blob/trunk/process.c#L4353
  *  This method is not for casual code but for application monitoring
  *  libraries. You can add custom code before and after fork events
  *  by overriding this method.
+ *
+ *  Note: Process.daemon may be implemented using fork(2) BUT does not go
+ *  through this method.
+ *  Thus, depending on your reason to hook into this method, you
+ *  may also want to hook into that one.
+ *  See {this issue}[https://bugs.ruby-lang.org/issues/18911] for a
+ *  more detailed discussion of this.
  */
 VALUE
 rb_proc__fork(VALUE _obj)
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]