You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's actually a very specific case, but I felt it could be generalized...
I came along with some lines of code which enumerates all file descriptors, and SetUnlinkOnClose(false) if listener.(UnixListener). it passes these file descriptors to a subprocess created by StartProcess. by doing this, it achieves graceful restart. on startup, the code SetUnlinkOnClose(true) on all the listeners passed to it, removing all the file descriptors the parent passed to the child.
however, the common sense is that a listener should not be unlinked if it's not created by the process. so the parent process have to tell the child which fds are to be preserved by passing a list.
without the getter, the parent process have to maintain a list containing all the fds to be preserved upon creating the listeners, this adds complexity, concurrency locks (listeners are created asynchronously) and of course an extra global variable. but with a getter, the parent process only have to build that list when forking the child process.