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


##########
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:
   It would be great to add comment according to @craigcondit response. The use 
of `fmt.Fprintf(os.Stderr)` is unusual in code base.



-- 
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