As I skim throw the code, I got that we don't have read-lock when performing logs.
This operation is safe if we don't dynamically change the log level at runtime via checkLogLocationEnabledNoLock(). But if we do, we have no read-lock to synchronize the loggerenabled flag.
The reason to do this, I guess, is that even if the flag is not synchronized, the few missing logs is not a problem, compared to the performance hurt with read-lock on every log. Could you guys elaborate more in detail?
As I skim throw the code, I got that we don't have read-lock when performing logs.
This operation is safe if we don't dynamically change the log level at runtime via
checkLogLocationEnabledNoLock()
. But if we do, we have no read-lock to synchronize the loggerenabled flag.The reason to do this, I guess, is that even if the flag is not synchronized, the few missing logs is not a problem, compared to the performance hurt with read-lock on every log. Could you guys elaborate more in detail?