Clust_mgr is an important compnent of KunlunBase. It provides a HTTP API for KunlunBase users to do cluster management, provisioning and monitor work, so that uses can install a cluster, a kunlun-server node, a storage shard or a kunlun-storage node by calling such APIs. Such capability enables users to integrate KunlunBase management and provisioning as part of their existing application or GUIs. Cluster_mgr also provide other important cluster maintenance background work to make sure the KunlunBase clusters it serves can work efficiently and reliably.
component: cluster manager | priority: major | resolution: finished
2022-03-09 15:02:26: snow@zettadb.com created the issue
== Daemonize function\
Daemonize process is widly used int the long term service sence.\
To achive the object, such machanisem was desinged below:\
fork()
do setsid() in child to renew session , detach from terminal
set sigaction
fork()
do umask() in child
close fd in child which bigger than 2
== special scene\
If the global variables exists and fetch a fd may equal 3 before do daemonzing operation\
When finish the daemonize func, however, the fd 3 is closed during the last step of the daemonize operations.After that, the main() refetch the fd which is assigned to 3 because of the lowest avilable FD principle.\
For now,everything is ok, excpet the global variables perform the close() on the fd 3,because it was not informed that the fd 3 is already be closed.\
If the usage of the fd 3 is related to the logger service unfortunately, error would occour like bad file descripter
== How to fix
Giving up to close the remained file descripter after fork()
Issue migrated from trac ticket # 477
component: cluster manager | priority: major | resolution: finished
2022-03-09 15:02:26: snow@zettadb.com created the issue