-
Notifications
You must be signed in to change notification settings - Fork 22
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
Continuous Profiling should be disabled by default until tiflash can be safely profiled #160
Comments
/assign |
Is it possible to avoid "Signal handler also makes system calls"? |
There are currently two choices for stack backtracking: In the past we were based on fn main() {
unsafe {
println!("before backtrace: {}", *libc::__errno_location());
}
let _ = backtrace::Backtrace::new();
unsafe {
println!("after backtrace: {}", *libc::__errno_location());
}
} The output is:
Now we are based on However, since the root cause of the problem on profiling on TiFlash is still unclear, we cannot determine whether the signal handler affects errno for the same reason. And, I may try to introduce eBPF in the near future to improve the performance and stability of profiling, refer to tikv/tikv#13336. |
See: pingcap/tiflash#5687
Continuous Profiling has been enabled by default since v6.1.0, so TiDB/TiKV/TiFlash will continue to trigger CPU profiling by default since v6.1.0. The CPU profiler of TiKV/TiFlash is pprof-rs. pprof-rs registers a signal handler during CPU profiling and periodically triggers the SIGPROF signal. After the SIGPROF signal is triggered, the signal handler is dispatched to the business thread for execution to sample the call stack of the current thread. Signal handler also makes system calls through glibc during execution, so it has a chance to affect errno. After the signal handler is executed, the business thread may get the wrong errno. However, errno has been protected in the current version of pprof-rs, so there is still no key evidence that the errno was modified by pprof-rs. The current judgment is based on two facts:
So, Continuous Profiling should be disabled by default until tiflash can be safely profiled.
The text was updated successfully, but these errors were encountered: