pbacsko commented on code in PR #1114:
URL: https://github.com/apache/yunikorn-core/pull/1114#discussion_r3692663316


##########
pkg/scheduler/objects/application.go:
##########
@@ -2162,6 +2164,18 @@ func (sa *Application) executeTerminatedCallback() {
        }
 }
 
+func (sa *Application) SetReservationReleasedCallback(callback func(released 
int)) {
+       sa.Lock()
+       defer sa.Unlock()
+       sa.reservationReleasedCallback = callback
+}
+
+func (sa *Application) executeReservationReleasedCallback(released int) {
+       if released > 0 && sa.reservationReleasedCallback != nil {
+               go sa.reservationReleasedCallback(released)

Review Comment:
   Why are we running this on a separate goroutine? Can't we just call 
`sa.reservationReleasedCallback(released)` directly?



##########
pkg/scheduler/objects/application.go:
##########
@@ -2162,6 +2164,18 @@ func (sa *Application) executeTerminatedCallback() {
        }
 }
 
+func (sa *Application) SetReservationReleasedCallback(callback func(released 
int)) {
+       sa.Lock()
+       defer sa.Unlock()
+       sa.reservationReleasedCallback = callback
+}
+
+func (sa *Application) executeReservationReleasedCallback(released int) {
+       if released > 0 && sa.reservationReleasedCallback != nil {
+               go sa.reservationReleasedCallback(released)

Review Comment:
   Why are we running this on a separate goroutine? Can't we just call 
`sa.reservationReleasedCallback(released)` synchronously?



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