In the code, to calculate the cpu limit, if the value of /cgroup/cpu/cpu.cfs_period_us
is 0, the program will generate the signal SIGFPE. Should we protect this by checking the value of period.first
?
code:
|
return quota.first / period.first; |
The error information:
Program received signal SIGFPE, Arithmetic exception.
0x000000000042d2d5 in ParseCPUFromCGroup() () at ./src/util.cc:650
650 return quota.first / period.first;