craigcondit commented on code in PR #843:
URL: https://github.com/apache/yunikorn-core/pull/843#discussion_r1566328914


##########
pkg/locking/locking.go:
##########
@@ -74,13 +77,26 @@ func reInit() {
        godeadlock.Opts.DeadlockTimeout = time.Duration(timeoutSec) * 
time.Second
        godeadlock.Opts.LogBuf = &errorBuf{}
        godeadlock.Opts.OnPotentialDeadlock = onPotentialDeadlock
+       if exitEnv, err := strconv.ParseBool(os.Getenv(EnvExitOnDeadlock)); err 
!= nil {
+               exitOnDeadlock = false
+       } else {
+               exitOnDeadlock = exitEnv
+       }
+
        if enabled {
-               fmt.Fprintf(os.Stderr, "=== Deadlock detection enabled 
(timeout: %d seconds) ===\n", timeoutSec)
+               fmt.Fprintf(os.Stderr, "=== Deadlock detection enabled 
(timeout: %d seconds, exit on deadlock: %v) ===\n", timeoutSec, exitOnDeadlock)

Review Comment:
   That's intentional to avoid pulling in unwanted dependencies. We want to 
ensure that we write this before any other subsystem is initialized, including 
logging (which may also use locks). It's also important enough to not risk 
being suppressed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to