-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with metrics in daemonize (-d) mode #2279
Comments
Does the http endpoint still work? |
It doesn't work
Because if I understand right the file ZeroTierOne/service/OneService.cpp Lines 2268 to 2277 in a681fbf
|
hmm does this mean it doesn't work on any type of redhat |
Probably, I don't have any other Red Hat nodes for testing. |
Hello, I have found a problem with ZeroTier metrics when zerotier-one daemon runs with the -d parameter.
Here is my current configuration:
ZeroTier was installed via the standard method:
The metrics file is empty:
You can also reproduce this issue simply by running
/usr/sbin/zerotier-one -d
Upon investigating further, I found that on AL2, you are using an init.d script that runs zerotier-one with the -d parameter. This flag initiates the fork() method and shuts down the main process as seen here:
ZeroTierOne/one.cpp
Line 2300 in a681fbf
This action triggers the execution of the destructor of the SaveToFile class, defined here:
ZeroTierOne/ext/prometheus-cpp-lite-1.0/core/include/prometheus/save_to_file.h
Line 53 in a681fbf
The execution of the destructor sets the global variable must_die to true. Since you are using fork() syscall, all processes share the same memory, so the worker_function thread stops before any metrics can be written.
Here is an example of a GDB session:
As a result, prometheus::SaveToFile::save_data() would never be called in this case.
The text was updated successfully, but these errors were encountered: