You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger tries to replace os.Stderr and os.Stdout, this is impossible to protect with mutex, because this is standard way for most of packages to write messages (via fmt or log or directly call write to this variables).
So i want to suggest to remove replacing in run() func that global variables. Also i'm found discussion in go issue about this golang/go#13473
One possible solution to do replacing is use guard process/forking. So some loader open fd for stderr stdout, fork process with stdout stderr and do logging. But for most cases this is not so good (but go uses something like this in case of syscall.Dup2 not supported by os)
Main issue with current approach - race detector always says about race conditions when we do
logger tries to replace os.Stderr and os.Stdout, this is impossible to protect with mutex, because this is standard way for most of packages to write messages (via fmt or log or directly call write to this variables).
So i want to suggest to remove replacing in run() func that global variables. Also i'm found discussion in go issue about this golang/go#13473
One possible solution to do replacing is use guard process/forking. So some loader open fd for stderr stdout, fork process with stdout stderr and do logging. But for most cases this is not so good (but go uses something like this in case of syscall.Dup2 not supported by os)
Main issue with current approach - race detector always says about race conditions when we do
The text was updated successfully, but these errors were encountered: